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 libc/21752] __stack_chk_fail should do as little work as possible


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

--- 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, hjl/pie/static has been created
        at  76509fc640af3dd76830949006946f4d19f83384 (commit)

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

commit 76509fc640af3dd76830949006946f4d19f83384
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 19 14:32:42 2017 -0700

    Add _startup_sbrk and _startup_fatal

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

commit 5094f18c49d54585af1d5aa62aaa1346af14879d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 19 09:32:45 2017 -0700

    i386: Define I386_USE_SYSENTER to 0 or 1 and check PIC

    Define I386_USE_SYSENTER to 0 or 1 so that special versions of syscalls
    with "int $0x80" can be provided for static PIE during start up.  Also
    check PIC instead SHARED for PIC version of syscall macros.

        * sysdeps/unix/sysv/linux/i386/sysdep.h (I386_USE_SYSENTER):
        Define to I386_USE_SYSENTER to 0 or 1 if not defined.
        (ENTER_KERNEL): Check if I386_USE_SYSENTER is 1 and check PIC.
        (INTERNAL_SYSCALL_MAIN_INLINE): Likewise.
        (INTERNAL_SYSCALL_NCS): Likewise.
        (LOADARGS_1): Likewise.
        (LOADARGS_5): Likewise.
        (RESTOREARGS_1): Likewise.
        (RESTOREARGS_5): Likewise.

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

commit 9712df2613cf78aa6592ee76a566501373c627af
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 18 15:46:40 2017 -0700

    i386: Check PIC in i386 multiarch functions

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

commit 9ef0ff32537eb6d08ffc78e1c34e40884496e42a
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 18 15:45:46 2017 -0700

    i386: Check PIC instead of SHARED in start.S

    Support static PIE.  Avoid relocation in static PIE since _start is
    called before it is relocated.

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

commit e6645591c35d61dd703b2a347208b212976a4085
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 18 10:42:48 2017 -0700

    Use hidden visibility for ENABLE_STATIC_PIE

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

commit 6cc544c111ce73ea655d9eeef7c7727ffe839b71
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Jul 17 13:53:52 2017 -0700

    Add _dl_relocate_static_pie

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

commit a0ba8ddafca01c9fd0db22c40ab8b6f7ee0c02ea
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Jul 17 08:54:40 2017 -0700

    Define pie-default/default-pie-ldflag for --enable-static-pie

    1. Add $(pie-default) to CFLAGS-.o and CFLAGS-.op.
    2. Add $(default-pie-ldflag) to +link-static-before-libc.
    3. Define +prectorT/+postctorT to $(+prectorS)/$(+postctorS).

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

commit d0079c616e1c087dc2461666579c9dd0196041f9
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 18 05:58:21 2017 -0700

    x86-64: Check if linker supports static PIE

    Need the linker with fix for:

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

    Binutils 2.29 is OK.

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

commit 9340f3ca8edfe1164e912f370617ada41979325b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Jul 17 08:36:45 2017 -0700

    Add --enable-static-pie

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

commit 1f7cf6a43dd46f4d5240cdb115d2046b147d5b7b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 21 05:07:19 2017 -0700

    Check if -static-pie works

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

commit 300f39770f15319b9927124408b0cb561e8165fb
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Mon Jul 17 08:17:32 2017 -0700

    Check if linker supports --no-dynamic-linker

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

commit 95f848ad771f3c53b539cf3dab50349a16ac7565
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 18 05:23:21 2017 -0700

    x86-64: Check PIC instead of SHARED in start.S

    PIC may be the default.

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

commit 509095e6ab37b9d0e323717c73b1f6edb79d1c9d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 18 15:36:20 2017 -0700

    x86: Remove assembly versions of HAS_CPU_FEATURE/HAS_ARCH_FEATURE

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

commit ba16d3befdaf500ba80a8589a72f66676f67e6f6
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 19 06:54:03 2017 -0700

    i386: Convert IFUNC selectors to C

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

commit 994ed23d7117ef2f4666b8c7a06a40b5a26f768e
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 18 15:35:30 2017 -0700

    x86-64: Convert libmathvec IFUNC selectors to C

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

commit 87e74ea270b29865c5c63c122886bffa33b82c39
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Tue Jul 18 13:56:17 2017 -0700

    x86-64: Convert libm IFUNC selectors to C

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

commit be329c484002349111004cb639e8ff847e26899b
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 19 08:46:08 2017 -0700

    i386: Don't define multiarch __memmove_chk in libc.a [BZ #21791]

    There is no need to define multiarch __memmove_chk in libc.a.

        [BZ #21791]
        * sysdeps/i386/i686/multiarch/memcpy-sse2-unaligned.S
        (MEMCPY_CHK): Define only if SHARED is defined.
        * sysdeps/i386/i686/multiarch/memcpy-ssse3-rep.S (MEMCPY_CHK):
        Likewise.
        * sysdeps/i386/i686/multiarch/memcpy-ssse3.S (MEMCPY_CHK):
        Likewise.

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

commit eec8437ce61980a00ca9bf3ab21b0d1545230929
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 19 10:56:19 2017 -0700

    Avoid accessing corrupted stack from __stack_chk_fail [BZ #21752]

    __libc_argv[0] points to address on stack and __libc_secure_getenv
    accesses environment variables which are on stack.  We should avoid
    accessing stack when stack is corrupted.

    This patch also renames function argument in __fortify_fail_abort
    from do_backtrace to need_backtrace to avoid confusion with do_backtrace
    from enum __libc_message_action.

        [BZ #21752]
        * debug/fortify_fail.c (__fortify_fail_abort): Don't pass down
        __libc_argv[0] if we aren't doing backtrace.  Rename do_backtrace
        to need_backtrace.
        * sysdeps/posix/libc_fatal.c (__libc_message): Don't call
        __libc_secure_getenv if we aren't doing backtrace.

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

commit 55849e2728b6899d79b543a3140c4e2065032b1d
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Wed Jul 19 16:53:06 2017 -0700

    tunables: Use direct syscall for access (BZ#21744)

    The function maybe_enable_malloc_check, which is called by
    __tunables_init, calls __access_noerrno.  It isn't problem when
    symbol is is in ld.so, which has a special version of __access_noerrno
    without stack protector.  But when glibc is built with stack protector,
    maybe_enable_malloc_check in libc.a can't call the regular version of
    __access_noerrno with stack protector.

    This patch changes how Linux defines the __access_noerrno to be an
    inline call instead and thus preventing defining different build
    rules for ld/static and shared.

        H.J. Lu  <hongjiu.lu@intel.com>
        Adhemerval Zanella  <adhemerval.zanella@linaro.org>

        * elf/dl-tunables.c: Include not-errno.h header.
        * include/unistd.h (__access_noerrno): Remove definition.
        * sysdeps/unix/sysv/linux/access.c (__access_noerrno): Likewise.
        * sysdeps/generic/not-errno.h: New file.
        * sysdeps/unix/sysv/linux/not-errno.h: Likewise.

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

-- 
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]