aboutsummaryrefslogtreecommitdiff
path: root/sysdeps
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2020-07-16 17:55:35 +0200
committerFlorian Weimer <fweimer@redhat.com>2020-07-16 17:55:35 +0200
commitefedd1ed3d211941fc66d14ba245be3552b2616a (patch)
tree67e2e7d222933fa2f442ff92019d4ba85eee23a2 /sysdeps
parentda7d62b50396c8b6d67c1ba800a196e83e2ec469 (diff)
downloadglibc-efedd1ed3d211941fc66d14ba245be3552b2616a.tar.xz
glibc-efedd1ed3d211941fc66d14ba245be3552b2616a.zip
Linux: Remove rseq support
The kernel ABI is not finalized, and there are now various proposals to change the size of struct rseq, which would make the glibc ABI dependent on the version of the kernels used for building glibc. This is of course not acceptable. This reverts commit 48699da1c468543ade14777819bd1b4d652709de ("elf: Support at least 32-byte alignment in static dlopen"), commit 8f4632deb3545b2949cec5454afc3cb21a0024ea ("Linux: rseq registration tests"), commit 6e29cb3f61ff5432c78a1c84b0d9b123a350ab36 ("Linux: Use rseq in sched_getcpu if available"), and commit 0c76fc3c2b346dc5401dc055d97d4279632b0fb3 ("Linux: Perform rseq registration at C startup and thread creation"), resolving the conflicts introduced by the ARC port and the TLS static surplus changes. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/generic/rseq-internal.h26
-rw-r--r--sysdeps/unix/sysv/linux/Makefile15
-rw-r--r--sysdeps/unix/sysv/linux/Versions1
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/bits/rseq.h43
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/alpha/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arc/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/be/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/arm/bits/rseq.h83
-rw-r--r--sysdeps/unix/sysv/linux/arm/le/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/bits/rseq.h29
-rw-r--r--sysdeps/unix/sysv/linux/csky/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/hppa/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/i386/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/ia64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m680x0/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/be/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/le/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/bits/rseq.h62
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/fpu/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/nofpu/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n32/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/n64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/nios2/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/rseq.h37
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/nofpu/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/riscv/rv64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/rseq-internal.h73
-rw-r--r--sysdeps/unix/sysv/linux/rseq-sym.c26
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/rseq.h37
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sched_getcpu.c22
-rw-r--r--sysdeps/unix/sysv/linux/sh/be/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sh/le/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc32/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sparc64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/sys/rseq.h203
-rw-r--r--sysdeps/unix/sysv/linux/tst-rseq-nptl.c256
-rw-r--r--sysdeps/unix/sysv/linux/tst-rseq.c64
-rw-r--r--sysdeps/unix/sysv/linux/tst-rseq.h59
-rw-r--r--sysdeps/unix/sysv/linux/x86/bits/rseq.h30
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/64/libc.abilist1
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/libc.abilist1
48 files changed, 5 insertions, 1092 deletions
diff --git a/sysdeps/generic/rseq-internal.h b/sysdeps/generic/rseq-internal.h
deleted file mode 100644
index 16f197397f..0000000000
--- a/sysdeps/generic/rseq-internal.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Restartable Sequences internal API. Stub version.
- Copyright (C) 2020 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef RSEQ_INTERNAL_H
-#define RSEQ_INTERNAL_H
-
-static inline void
-rseq_register_current_thread (void)
-{
-}
-
-#endif /* rseq-internal.h */
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 1932ccf7df..9b2a253032 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -41,7 +41,7 @@ update-syscall-lists: arch-syscall.h
endif
ifeq ($(subdir),csu)
-sysdep_routines += errno-loc rseq-sym
+sysdep_routines += errno-loc
endif
ifeq ($(subdir),assert)
@@ -94,19 +94,14 @@ sysdep_headers += sys/mount.h sys/acct.h \
bits/types/struct_semid_ds.h \
bits/types/struct_msqid_ds.h \
bits/types/struct_shmid_ds.h \
- bits/ipc-perm.h \
- sys/rseq.h bits/rseq.h
+ bits/ipc-perm.h
tests += tst-clone tst-clone2 tst-clone3 tst-fanotify tst-personality \
tst-quota tst-sync_file_range tst-sysconf-iov_max tst-ttyname \
test-errno-linux tst-memfd_create tst-mlock2 tst-pkey \
tst-rlimit-infinity tst-ofdlocks tst-gettid tst-gettid-kill \
tst-tgkill
-
-# tst-rseq is an internal test because it requires a definition of __NR_rseq
-# from the internal system call list.
-tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc \
- tst-rseq
+tests-internal += tst-ofdlocks-compat tst-sigcontext-get_pc
CFLAGS-tst-sigcontext-get_pc.c = -fasynchronous-unwind-tables
@@ -307,8 +302,4 @@ endif
ifeq ($(subdir),nptl)
tests += tst-align-clone tst-getpid1
-
-# tst-rseq-nptl is an internal test because it requires a definition of
-# __NR_rseq from the internal system call list.
-tests-internal += tst-rseq-nptl
endif
diff --git a/sysdeps/unix/sysv/linux/Versions b/sysdeps/unix/sysv/linux/Versions
index f72741b7e5..c35f783e2a 100644
--- a/sysdeps/unix/sysv/linux/Versions
+++ b/sysdeps/unix/sysv/linux/Versions
@@ -168,7 +168,6 @@ libc {
getdents64; gettid; tgkill;
}
GLIBC_2.32 {
- __rseq_abi;
}
GLIBC_PRIVATE {
# functions used in other libraries
diff --git a/sysdeps/unix/sysv/linux/aarch64/bits/rseq.h b/sysdeps/unix/sysv/linux/aarch64/bits/rseq.h
deleted file mode 100644
index b6f6e536f4..0000000000
--- a/sysdeps/unix/sysv/linux/aarch64/bits/rseq.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Restartable Sequences Linux aarch64 architecture header.
- Copyright (C) 2020 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_RSEQ_H
-# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
-#endif
-
-/* RSEQ_SIG is a signature required before each abort handler code.
-
- It is a 32-bit value that maps to actual architecture code compiled
- into applications and libraries. It needs to be defined for each
- architecture. When choosing this value, it needs to be taken into
- account that generating invalid instructions may have ill effects on
- tools like objdump, and may also have impact on the CPU speculative
- execution efficiency in some cases.
-
- aarch64 -mbig-endian generates mixed endianness code vs data:
- little-endian code and big-endian data. Ensure the RSEQ_SIG signature
- matches code endianness. */
-
-#define RSEQ_SIG_CODE 0xd428bc00 /* BRK #0x45E0. */
-
-#ifdef __AARCH64EB__
-# define RSEQ_SIG_DATA 0x00bc28d4 /* BRK #0x45E0. */
-#else
-# define RSEQ_SIG_DATA RSEQ_SIG_CODE
-#endif
-
-#define RSEQ_SIG RSEQ_SIG_DATA
diff --git a/sysdeps/unix/sysv/linux/aarch64/libc.abilist b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
index 008a6c8e52..6cd61988b4 100644
--- a/sysdeps/unix/sysv/linux/aarch64/libc.abilist
+++ b/sysdeps/unix/sysv/linux/aarch64/libc.abilist
@@ -2150,7 +2150,6 @@ GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
GLIBC_2.32 pthread_attr_getsigmask_np F
GLIBC_2.32 pthread_attr_setaffinity_np F
GLIBC_2.32 pthread_attr_setsigmask_np F
diff --git a/sysdeps/unix/sysv/linux/alpha/libc.abilist b/sysdeps/unix/sysv/linux/alpha/libc.abilist
index 2cfc5733ed..8edb5deea1 100644
--- a/sysdeps/unix/sysv/linux/alpha/libc.abilist
+++ b/sysdeps/unix/sysv/linux/alpha/libc.abilist
@@ -2232,7 +2232,6 @@ GLIBC_2.30 gettid F
GLIBC_2.30 tgkill F
GLIBC_2.30 twalk_r F
GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
GLIBC_2.32 pthread_attr_getsigmask_np F
GLIBC_2.32 pthread_attr_setaffinity_np F
GLIBC_2.32 pthread_attr_setsigmask_np F
diff --git a/sysdeps/unix/sysv/linux/arc/libc.abilist b/sysdeps/unix/sysv/linux/arc/libc.abilist
index 0d1ce97229..df13f49e15 100644
--- a/sysdeps/unix/sysv/linux/arc/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arc/libc.abilist
@@ -345,7 +345,6 @@ GLIBC_2.32 __res_nclose F
GLIBC_2.32 __res_ninit F
GLIBC_2.32 __res_randomid F
GLIBC_2.32 __res_state F
-GLIBC_2.32 __rseq_abi T 0x20
GLIBC_2.32 __sbrk F
GLIBC_2.32 __sched_cpualloc F
GLIBC_2.32 __sched_cpucount F
diff --git a/sysdeps/unix/sysv/linux/arm/be/libc.abilist b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
index 0e1677b5a0..7f4a146d22 100644
--- a/sysdeps/unix/sysv/linux/arm/be/libc.abilist
+++ b/sysdeps/unix/sysv/linux/arm/be/libc.abilist
@@ -134,7 +134,6 @@ GLIBC_2.31 msgctl F
GLIBC_2.31 semctl F
GLIBC_2.31 shmctl F
GLIBC_2.32 __libc_single_threaded D 0x1
-GLIBC_2.32 __rseq_abi T 0x20
GLIBC_2.32 pthread_attr_getsigmask_np F
GLIBC_2.32 pthread_attr_setaffinity_np F
GLIBC_2.32 pthread_attr_setsigmask_np F
diff --git a/sysdeps/unix/sysv/linux/arm/bits/rseq.h b/sysdeps/unix/sysv/linux/arm/bits/rseq.h
deleted file mode 100644
index 2bf780efcd..0000000000
--- a/sysdeps/unix/sysv/linux/arm/bits/rseq.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Restartable Sequences Linux arm architecture header.
- Copyright (C) 2020 Free Software Foundation, Inc.
-
- The GNU C Library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
-
- The GNU C Library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, see
- <https://www.gnu.org/licenses/>. */
-
-#ifndef _SYS_RSEQ_H
-# error "Never use <bits/rseq.h> directly; include <sys/rseq.h> instead."
-#endif
-
-/*
- RSEQ_SIG is a signature required before each abort handler code.
-
- It is a 32-bit value that maps to actual architecture code compiled
- into applications and libraries. It needs to be defined for each
- architecture. When choosing this value, it needs to be taken into
- account that generating invalid instructions may have ill effects on
- tools like objdump, and may also have impact on the CPU speculative
- execution efficiency in some cases.
-
- - ARM little endian
-
- RSEQ_SIG uses the udf A32 instruction with an uncommon immediate operand
- value 0x5de3. This traps if user-space reaches this instruction by mistake,
- and the uncommon operand ensures the kernel does not move the instruction
- pointer to attacker-controlled code on rseq abort.
-
- The instruction pattern in the A32 instruction set is:
-
- e7f5def3 udf #24035 ; 0x5de3
-
- This translates to the following instruction pattern in the T16 instruction
- set:
-
- little endian:
- def3 udf #243 ; 0xf3
- e7f5 b.n <7f5>
-
- - ARMv6+ big endian (BE8):
-
- ARMv6+ -mbig-endian generates mixed endianness code vs data: little-endian
- code and big-endian data. The data value of the signature needs to have its
- byte order reversed to generate the trap instruction:
-
- Data: 0xf3def5e7
-
- Translates to this A32 instruction pattern:
-
- e7f5def3 udf #24035 ; 0x5de3
-
- Translates to this T16 instruction pattern:
-
- def3 udf #243 ; 0xf3
- e7f5 b.n <7f5>
-
- - Prior to ARMv6 big endian (BE32):
-
- Prior to ARMv6, -mbig-endian generates big-endian code and data
- (which match), so the endianness of the data representation of the
- signature should not be reversed. However, the choice between BE32
- and BE8 is done by the linker, so we cannot know whether code and
- data endianness will be mixed before the linker i