elf: Ignore GLIBC_TUNABLES for setuid/setgid binaries
commit9c96c87d60eafa4d78406e606e92b42bd4b570ad
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 6 Nov 2023 20:25:36 +0000 (6 17:25 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 21 Nov 2023 19:15:42 +0000 (21 16:15 -0300)
treef2b1db62e65cdf8cae4e058bea8e40aae847dc16
parenta72a4eb10b2d9aef7a53f9d2facf166a685d85fb
elf: Ignore GLIBC_TUNABLES for setuid/setgid binaries

The tunable privilege levels were a retrofit to try and keep the malloc
tunable environment variables' behavior unchanged across security
boundaries.  However, CVE-2023-4911 shows how tricky can be
tunable parsing in a security-sensitive environment.

Not only parsing, but the malloc tunable essentially changes some
semantics on setuid/setgid processes.  Although it is not a direct
security issue, allowing users to change setuid/setgid semantics is not
a good security practice, and requires extra code and analysis to check
if each tunable is safe to use on all security boundaries.

It also means that security opt-in features, like aarch64 MTE, would
need to be explicit enabled by an administrator with a wrapper script
or with a possible future system-wide tunable setting.

Co-authored-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: DJ Delorie <dj@redhat.com>
elf/Makefile
elf/dl-tunable-types.h
elf/dl-tunables.c
elf/dl-tunables.list
elf/tst-env-setuid-tunables.c
elf/tst-tunables.c [new file with mode: 0644]
manual/README.tunables
scripts/gen-tunables.awk
sysdeps/x86_64/64/dl-tunables.list