aboutsummaryrefslogtreecommitdiff
path: root/misc/Makefile
diff options
context:
space:
mode:
authorArjun Shankar <arjun@redhat.com>2024-01-15 17:44:43 +0100
committerArjun Shankar <arjun@redhat.com>2024-01-30 15:53:37 +0100
commit6bd0e4efcc78f3c0115e5ea9739a1642807450da (patch)
tree18ec2375433978e7a6aef01108958524f539a8d6 /misc/Makefile
parent8aeec0eb5a18f9614d18156f9d6092b3525b818c (diff)
downloadglibc-6bd0e4efcc78f3c0115e5ea9739a1642807450da.tar
glibc-6bd0e4efcc78f3c0115e5ea9739a1642807450da.tar.gz
glibc-6bd0e4efcc78f3c0115e5ea9739a1642807450da.tar.bz2
glibc-6bd0e4efcc78f3c0115e5ea9739a1642807450da.zip
syslog: Fix heap buffer overflow in __vsyslog_internal (CVE-2023-6246)
__vsyslog_internal did not handle a case where printing a SYSLOG_HEADER containing a long program name failed to update the required buffer size, leading to the allocation and overflow of a too-small buffer on the heap. This commit fixes that. It also adds a new regression test that uses glibc.malloc.check. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org> Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>
Diffstat (limited to 'misc/Makefile')
-rw-r--r--misc/Makefile8
1 files changed, 7 insertions, 1 deletions
diff --git a/misc/Makefile b/misc/Makefile
index 42899c2b6c..c273ec6974 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -289,7 +289,10 @@ tests-special += $(objpfx)tst-error1-mem.out \
$(objpfx)tst-allocate_once-mem.out
endif
-tests-container := tst-syslog
+tests-container := \
+ tst-syslog \
+ tst-syslog-long-progname \
+ # tests-container
CFLAGS-select.c += -fexceptions -fasynchronous-unwind-tables
CFLAGS-tsearch.c += $(uses-callbacks)
@@ -351,6 +354,9 @@ $(objpfx)tst-allocate_once-mem.out: $(objpfx)tst-allocate_once.out
$(common-objpfx)malloc/mtrace $(objpfx)tst-allocate_once.mtrace > $@; \
$(evaluate-test)
+tst-syslog-long-progname-ENV = GLIBC_TUNABLES=glibc.malloc.check=3 \
+ LD_PRELOAD=libc_malloc_debug.so.0
+
$(objpfx)tst-select: $(librt)
$(objpfx)tst-select-time64: $(librt)
$(objpfx)tst-pselect: $(librt)