You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.8 KiB
53 lines
1.8 KiB
7 months ago
|
commit 7835b00dbce53c3c87bbbb1754a95fb5e58187aa
|
||
|
Author: Florian Weimer <fweimer@redhat.com>
|
||
|
Date: Thu Apr 25 15:01:07 2024 +0200
|
||
|
|
||
|
CVE-2024-33600: nscd: Do not send missing not-found response in addgetnetgrentX (bug 31678)
|
||
|
|
||
|
If we failed to add a not-found response to the cache, the dataset
|
||
|
point can be null, resulting in a null pointer dereference.
|
||
|
|
||
|
Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
|
||
|
|
||
|
diff --git a/nscd/netgroupcache.c b/nscd/netgroupcache.c
|
||
1 month ago
|
index f227dc7fa2..c18fe111f3 100644
|
||
7 months ago
|
--- a/nscd/netgroupcache.c
|
||
|
+++ b/nscd/netgroupcache.c
|
||
1 month ago
|
@@ -147,7 +147,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
||
7 months ago
|
/* No such service. */
|
||
|
cacheable = do_notfound (db, fd, req, key, &dataset, &total, &timeout,
|
||
|
&key_copy);
|
||
|
- goto writeout;
|
||
|
+ goto maybe_cache_add;
|
||
|
}
|
||
|
|
||
|
memset (&data, '\0', sizeof (data));
|
||
1 month ago
|
@@ -348,7 +348,7 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
||
7 months ago
|
{
|
||
|
cacheable = do_notfound (db, fd, req, key, &dataset, &total, &timeout,
|
||
|
&key_copy);
|
||
|
- goto writeout;
|
||
|
+ goto maybe_cache_add;
|
||
|
}
|
||
|
|
||
|
total = buffilled;
|
||
1 month ago
|
@@ -410,14 +410,12 @@ addgetnetgrentX (struct database_dyn *db, int fd, request_header *req,
|
||
7 months ago
|
}
|
||
|
|
||
|
if (he == NULL && fd != -1)
|
||
|
- {
|
||
|
- /* We write the dataset before inserting it to the database
|
||
|
- since while inserting this thread might block and so would
|
||
|
- unnecessarily let the receiver wait. */
|
||
|
- writeout:
|
||
|
+ /* We write the dataset before inserting it to the database since
|
||
|
+ while inserting this thread might block and so would
|
||
|
+ unnecessarily let the receiver wait. */
|
||
|
writeall (fd, &dataset->resp, dataset->head.recsize);
|
||
|
- }
|
||
|
|
||
|
+ maybe_cache_add:
|
||
|
if (cacheable)
|
||
|
{
|
||
|
/* If necessary, we also propagate the data to disk. */
|