This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/21269] i386 sigaction sa_restorer handling is wrong


https://sourceware.org/bugzilla/show_bug.cgi?id=21269

--- Comment #6 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, master-push has been created
        at  5226a81f5517bcbc892679cca792006a6bafc53f (commit)

- Log -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=5226a81f5517bcbc892679cca792006a6bafc53f

commit 5226a81f5517bcbc892679cca792006a6bafc53f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Fri Mar 2 13:04:36 2018 -0300

    Define _DIRENT_MATCHES_DIRENT64 regardless

    This patch defines _DIRENT_MATCHES_DIRENT64 to either 0 or 1 and adjust its
    usage from checking its definition to its value.

    Checked on a build for major Linux abis.

        * bits/dirent.h (__INO_T_MATCHES_INO64_T): Define regardless whether
        __INO_T_MATCHES_INO64_T is defined.
        * sysdeps/unix/sysv/linux/bits/dirent.h: Likewise.
        * dirent/alphasort.c: Check _DIRENT_MATCHES_DIRENT64 value instead
        of definition.
        * dirent/alphasort64.c: Likewise.
        * dirent/scandir.c: Likewise.
        * dirent/scandir64-tail.c: Likewise.
        * dirent/scandir64.c: Likewise.
        * dirent/scandirat.c: Likewise.
        * dirent/scandirat64.c: Likewise.
        * dirent/versionsort.c: Likewise.
        * dirent/versionsort64.c: Likewise.
        * include/dirent.h: Likewise.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=fbd01e6c4427b558b63fedb938b7fc5fada8c6b8

commit fbd01e6c4427b558b63fedb938b7fc5fada8c6b8
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Feb 22 15:47:33 2018 -0300

    nptl: Fix tst-cancel4 sendto tests

    Now that send might be implemented calling sendto syscall on Linux,
    I am seeing some issue in some kernel configurations where tst-cancel4
    sendto do not block as expected.

    The socket used to force the syscall blocking is used with default
    system configuration for buffer sending size, which might not be
    suffice to force blocking.  This patch fixes it by explicit setting
    buffer socket lower than the buffer size used.  It also enables sendto
    cancellation tests to work in both ways (since internally send is
    implemented routing to sendto on Linux kernel).

    The patch also removes unrequired make rules on some archictures
    for send/recv. The generic nptl Makefile already set the compiler flags
    required on some architectures for correct unwinding and libc object
    are not strictly required to support unwind (since pthread_cancel
    requires linking against libpthread).

    Checked on aarch64-linux-gnu and x86_64-linux-gnu. I also did a
    sniff test with tst-cancel{4,5} on a simulated mips64-linux-gnu.

        * nptl/tst-cancel4-common.h (set_socket_buffer): New function.
        * nptl/tst-cancel4-common.c (do_test): Call set_socket_buffer
        for socketpair endpoint.
        * nptl/tst-cancel4.c (tf_send): Call set_socket_buffer and use
        WRITE_BUFFER_SIZE as buffer size for sending socket.
        (tf_sendto): Use SOCK_STREAM instead of SOCK_DGRAM and fix an
        issue on system where send is implemented with sendto syscall.
        * sysdeps/unix/sysv/linux/mips/mips64/Makefile [$(subdir) = socket]
        (CFLAGS-recv.c, CFLAGS-send.c): Remove rules.
        [$(subdir) = nptl] (CFLAGS-recv.c, CFLAGS-send.c): Likewise.
        * sysdeps/unix/sysv/linux/riscv/rv64/Makefile: Remove file.

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=68448be208ee06e76665918b37b0a57e3e00c8b4

commit 68448be208ee06e76665918b37b0a57e3e00c8b4
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.

-----------------------------------------------------------------------

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]