CVE-2024-33601, CVE-2024-33602: nscd: netgroup: Use two buffers in addgetnetgrentX...
authorFlorian Weimer <fweimer@redhat.com>
Thu, 25 Apr 2024 13:01:07 +0000 (15:01 +0200)
committerAdrian Bunk <bunk@debian.org>
Sat, 29 Jun 2024 10:27:34 +0000 (13:27 +0300)
commit86d6f71a1d04906b1a10e13ffb4c0cfb9cd0c559
tree76efe0c5d6b1e9466748f3a2b314576e78da6beb
parentd60203827a529508f2e878c7f140b38b0073a9d1
CVE-2024-33601, CVE-2024-33602: nscd: netgroup: Use two buffers in addgetnetgrentX (bug 31680)

This avoids potential memory corruption when the underlying NSS
callback function does not use the buffer space to store all strings
(e.g., for constant strings).

Instead of custom buffer management, two scratch buffers are used.
This increases stack usage somewhat.

Scratch buffer allocation failure is handled by return -1
(an invalid timeout value) instead of terminating the process.
This fixes bug 31679.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Gbp-Pq: Topic all
Gbp-Pq: Name git-0004-CVE-2024-33601-CVE-2024-33602-nscd-netgroup-Use-two-.patch
nscd/netgroupcache.c