[PATCH] tunables: Avoid getenv calls and disable glibc.malloc.check by default

Siddhesh Poyarekar siddhesh@sourceware.org
Mon Jan 2 19:37:00 GMT 2017


Builds with --enable-tunables failed on i686 because a call to getenv
got snuck into tunables, which pulled in strncmp.  This patch fixes
this build failure by making the glibc.malloc.check check even
simpler.  The previous approach was convoluted where the tunable was
disabled using an unsetenv and overwriting the tunable value with
colons.  The easier way is to simply mark the tunable as insecure by
default (i.e. won't be read for AT_SECURE programs) and then enabled
only when the /etc/suid-debug file is found.

This also ends up removing a bunch of functions that were specially
reimplemented (strlen, unsetenv) to avoid calling into string
routines.

Tested on x86_64 and i686.

        * elf/dl-tunables.c (tunables_unsetenv): Remove function.
        (min_strlen): Likewise.
        (disable_tunable): Likewise.
        (maybe_disable_malloc_check): Rename to
        maybe_enable_malloc_check.
        (maybe_enable_malloc_check): Enable glibc.malloc.check tunable
        if /etc/suid-debug file exists.
        (__tunables_init): Update caller.
        * elf/dl-tunables.list (glibc.malloc.check): Don't mark as
        secure.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tunables-Avoid-getenv-calls-and-disable-glibc.malloc.patch
Type: text/x-patch
Size: 3857 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20170102/95d4fb16/attachment.bin>


More information about the Libc-alpha mailing list