[Bug dynamic-link/21269] i386 sigaction sa_restorer handling is wrong
cvs-commit at gcc dot gnu.org
sourceware-bugzilla@sourceware.org
Thu May 17 12:43:00 GMT 2018
https://sourceware.org/bugzilla/show_bug.cgi?id=21269
--- Comment #10 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, release/2.26/master has been updated
via 3241353ab20b4cc8798088d456ffa9aace1514de (commit)
from 677e6d13e0d59b35720b4d71af4a8d9038aedc6a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=3241353ab20b4cc8798088d456ffa9aace1514de
commit 3241353ab20b4cc8798088d456ffa9aace1514de
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Fri Nov 17 16:04:29 2017 -0200
i386: Fix i386 sigaction sa_restorer initialization (BZ#21269)
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.
(cherry picked from commit 68448be208ee06e76665918b37b0a57e3e00c8b4)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 8 +
NEWS | 1 +
sysdeps/unix/sysv/linux/i386/Makefile | 3 +
sysdeps/unix/sysv/linux/i386/sigaction.c | 3 +-
sysdeps/unix/sysv/linux/i386/tst-bz21269.c | 233 ++++++++++++++++++++++++++++
5 files changed, 247 insertions(+), 1 deletions(-)
create mode 100644 sysdeps/unix/sysv/linux/i386/tst-bz21269.c
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Glibc-bugs
mailing list