2a30b8f4b2
Upstream commit: dcaf51b41e259387602774829c45222d0507f90a - elf: Change ldconfig auxcache magic number (bug 32231) - Make tst-strtod-underflow type-generic - Add crt1-2.0.o for glibc 2.0 compatibility tests - Add tests of more strtod special cases - Add more tests of strtod end pointer - Make tst-strtod2 and tst-strtod5 type-generic - powerpc64le: Build new strtod tests with long double ABI flags (bug 32145) - Do not set errno for overflowing NaN payload in strtod/nan (bug 32045) - Improve NaN payload testing - Make __strtod_internal tests type-generic - Fix strtod subnormal rounding (bug 30220) - More thoroughly test underflow / errno in tst-strtod-round - Test errno setting on strtod overflow in tst-strtod-round - Add tests of fread - stdio-common: Add new test for fdopen - libio: Attempt wide backup free only for non-legacy code - debug: Fix read error handling in pcprofiledump - elf: Fix tst-dlopen-tlsreinit1.out test dependency - elf: Avoid re-initializing already allocated TLS in dlopen (bug 31717) - elf: Clarify and invert second argument of _dl_allocate_tls_init - elf: Support recursive use of dynamic TLS in interposed malloc - nptl: Use <support/check.h> facilities in tst-setuid3 - posix: Use <support/check.h> facilities in tst-truncate and tst-truncate64 - ungetc: Fix backup buffer leak on program exit [BZ #27821] - ungetc: Fix uninitialized read when putting into unused streams [BZ #27821] - Make tst-ungetc use libsupport - stdio-common: Add test for vfscanf with matches longer than INT_MAX [BZ #27650] - support: Add FAIL test failure helper - string: strerror, strsignal cannot use buffer after dlmopen (bug 32026) - Define __libc_initial for the static libc - x86: Fix bug in strchrnul-evex512 [BZ #32078] - Adjust check-local-headers test for libaudit 4.0 - x32/cet: Support shadow stack during startup for Linux 6.10 - x86-64: Remove sysdeps/x86_64/x32/dl-machine.h - support: Add options list terminator to the test driver - manual/stdio: Further clarify putc, putwc, getc, and getwc - Fix name space violation in fortify wrappers (bug 32052) - resolv: Fix tst-resolv-short-response for older GCC (bug 32042) - Add mremap tests - mremap: Update manual entry - linux: Update the mremap C implementation [BZ #31968] - Enhanced test coverage for strncmp, wcsncmp - Enhance test coverage for strnlen, wcsnlen Resolves: RHEL-57776 Resolves: RHEL-57777 Resolves: RHEL-61392
73 lines
2.9 KiB
Diff
73 lines
2.9 KiB
Diff
commit 9fbbe86f7c6ab19356cfa7ca15b4b7c29b72e8cb
|
|
Author: H.J. Lu <hjl.tools@gmail.com>
|
|
Date: Mon Jul 22 17:47:22 2024 -0700
|
|
|
|
x32/cet: Support shadow stack during startup for Linux 6.10
|
|
|
|
Use RXX_LP in RTLD_START_ENABLE_X86_FEATURES. Support shadow stack during
|
|
startup for Linux 6.10:
|
|
|
|
commit 2883f01ec37dd8668e7222dfdb5980c86fdfe277
|
|
Author: H.J. Lu <hjl.tools@gmail.com>
|
|
Date: Fri Mar 15 07:04:33 2024 -0700
|
|
|
|
x86/shstk: Enable shadow stacks for x32
|
|
|
|
1. Add shadow stack support to x32 signal.
|
|
2. Use the 64-bit map_shadow_stack syscall for x32.
|
|
3. Set up shadow stack for x32.
|
|
|
|
Add the map_shadow_stack system call to <fixup-asm-unistd.h> and regenerate
|
|
arch-syscall.h. Tested on Intel Tiger Lake with CET enabled x32. There
|
|
are no regressions with CET enabled x86-64. There are no changes in CET
|
|
enabled x86-64 _dl_start_user.
|
|
|
|
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
|
|
Reviewed-by: Noah Goldstein <goldstein.w.n@gmail.com>
|
|
(cherry picked from commit 8344c1f5514b1b5b1c8c6e48f4b802653bd23b71)
|
|
|
|
diff --git a/sysdeps/unix/sysv/linux/x86_64/dl-cet.h b/sysdeps/unix/sysv/linux/x86_64/dl-cet.h
|
|
index 1fe313340611d9c5..b4f7e6c9cd7548a2 100644
|
|
--- a/sysdeps/unix/sysv/linux/x86_64/dl-cet.h
|
|
+++ b/sysdeps/unix/sysv/linux/x86_64/dl-cet.h
|
|
@@ -92,9 +92,9 @@ dl_cet_ibt_enabled (void)
|
|
# Pass GL(dl_x86_feature_1) to _dl_cet_setup_features.\n\
|
|
movl %edx, %edi\n\
|
|
# Align stack for the _dl_cet_setup_features call.\n\
|
|
- andq $-16, %rsp\n\
|
|
+ and $-16, %" RSP_LP "\n\
|
|
call _dl_cet_setup_features\n\
|
|
# Restore %rax and %rsp from %r12 and %r13.\n\
|
|
- movq %r12, %rax\n\
|
|
- movq %r13, %rsp\n\
|
|
+ mov %" R12_LP ", %" RAX_LP "\n\
|
|
+ mov %" R13_LP ", %" RSP_LP "\n\
|
|
"
|
|
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
|
|
index b9db8bc5be05eed8..645e85802f95a78c 100644
|
|
--- a/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
|
|
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/arch-syscall.h
|
|
@@ -151,6 +151,7 @@
|
|
#define __NR_lsetxattr 1073742013
|
|
#define __NR_lstat 1073741830
|
|
#define __NR_madvise 1073741852
|
|
+#define __NR_map_shadow_stack 1073742277
|
|
#define __NR_mbind 1073742061
|
|
#define __NR_membarrier 1073742148
|
|
#define __NR_memfd_create 1073742143
|
|
diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/fixup-asm-unistd.h b/sysdeps/unix/sysv/linux/x86_64/x32/fixup-asm-unistd.h
|
|
index 98124169e6035ea8..47fa8af4ce9af68e 100644
|
|
--- a/sysdeps/unix/sysv/linux/x86_64/x32/fixup-asm-unistd.h
|
|
+++ b/sysdeps/unix/sysv/linux/x86_64/x32/fixup-asm-unistd.h
|
|
@@ -15,6 +15,10 @@
|
|
License along with the GNU C Library; if not, see
|
|
<http://www.gnu.org/licenses/>. */
|
|
|
|
+#ifndef __NR_map_shadow_stack
|
|
+# define __NR_map_shadow_stack 1073742277
|
|
+#endif
|
|
+
|
|
/* X32 uses the same 64-bit syscall interface for set_thread_area. */
|
|
#ifndef __NR_set_thread_area
|
|
# define __NR_set_thread_area 1073742029
|