mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-11 13:50:06 +00:00
68448be208
This patch fixes the i386 sa_restorer field initialization for sigaction syscall for kernel with vDSO. As described in bug report, i386 Linux (and compat on x86_64) interprets SA_RESTORER clear with nonzero sa_restorer as a request for stack switching if the SS segment is 'funny'. This means that anything that tries to mix glibc's signal handling with segmentation (for instance through modify_ldt syscall) is randomly broken depending on what values lands in sa_restorer. The testcase added is based on Linux test tools/testing/selftests/x86/ldt_gdt.c, more specifically in do_multicpu_tests function. The main changes are: - C11 atomics instead of plain access. - Remove x86_64 support which simplifies the syscall handling and fallbacks. - Replicate only the test required to trigger the issue. Checked on i686-linux-gnu. [BZ #21269] * sysdeps/unix/sysv/linux/i386/Makefile (tests): Add tst-bz21269. * sysdeps/unix/sysv/linux/i386/sigaction.c (SET_SA_RESTORER): Clear sa_restorer for vDSO case. * sysdeps/unix/sysv/linux/i386/tst-bz21269.c: New file.
50 lines
990 B
Makefile
50 lines
990 B
Makefile
# The default ABI is 32.
|
|
default-abi := 32
|
|
|
|
ifeq ($(subdir),misc)
|
|
sysdep_routines += ioperm iopl vm86
|
|
|
|
tests += tst-bz21269
|
|
$(objpfx)tst-bz21269: $(shared-thread-library)
|
|
endif
|
|
|
|
ifeq ($(subdir),elf)
|
|
sysdep-dl-routines += libc-do-syscall
|
|
sysdep-others += lddlibc4
|
|
install-bin += lddlibc4
|
|
endif
|
|
|
|
ifeq ($(subdir),io)
|
|
sysdep_routines += libc-do-syscall
|
|
endif
|
|
|
|
ifeq ($(subdir),nptl)
|
|
libpthread-sysdep_routines += libc-do-syscall
|
|
libpthread-shared-only-routines += libc-do-syscall
|
|
endif
|
|
|
|
ifeq ($(subdir),stdlib)
|
|
gen-as-const-headers += ucontext_i.sym
|
|
endif
|
|
|
|
ifeq ($(subdir),csu)
|
|
sysdep-dl-routines += sysdep
|
|
ifeq (yes,$(build-shared))
|
|
sysdep_routines += divdi3
|
|
shared-only-routines += divdi3
|
|
CPPFLAGS-divdi3.c = -Din_divdi3_c
|
|
endif
|
|
endif
|
|
|
|
ifeq ($(subdir),nptl)
|
|
# pull in __syscall_error routine
|
|
libpthread-routines += sysdep
|
|
libpthread-shared-only-routines += sysdep
|
|
endif
|
|
|
|
ifeq ($(subdir),rt)
|
|
# pull in __syscall_error routine
|
|
librt-routines += sysdep
|
|
librt-shared-only-routines += sysdep
|
|
endif
|