]> git.ipfire.org Git - thirdparty/glibc.git/commit
tunables: Terminate if end of input is reached (CVE-2023-4911)
authorSiddhesh Poyarekar <siddhesh@sourceware.org>
Tue, 19 Sep 2023 22:39:32 +0000 (18:39 -0400)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Mon, 2 Oct 2023 19:35:29 +0000 (15:35 -0400)
commit1056e5b4c3f2d90ed2b4a55f96add28da2f4c8fa
tree7c97228a74e8790ae0a48a64254bfb977922dff6
parent0d5f9ea97f1b39f2a855756078771673a68497e1
tunables: Terminate if end of input is reached (CVE-2023-4911)

The string parsing routine may end up writing beyond bounds of tunestr
if the input tunable string is malformed, of the form name=name=val.
This gets processed twice, first as name=name=val and next as name=val,
resulting in tunestr being name=name=val:name=val, thus overflowing
tunestr.

Terminate the parsing loop at the first instance itself so that tunestr
does not overflow.

This also fixes up tst-env-setuid-tunables to actually handle failures
correct and add new tests to validate the fix for this CVE.

Signed-off-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
NEWS
elf/dl-tunables.c
elf/tst-env-setuid-tunables.c