Fix logic error in TFTP caching.

The TFTP subsystem prefetches data from disk. If a TFTP transfer
is freed, and a new one allocated the same memory, then previously
prefetched data could be wrongly supplied.

Thanks to Lucas Celant <lcelant@redhat.com> for spotting this.

CVE-2026-93006 may apply.
This commit is contained in:
Simon Kelley committed 2026-10-20 00:07:33 +01:00
1 parent 11493fe218
commit cdbfb97227
1 file changed
+6
+6
View File
@@ -836,6 +836,12 @@ static void free_transfer(struct tftp_transfer *transfer)
close(transfer->file->fd);
free(transfer->file);
}
/* freeing this transfer and then allocating a new one
may result in the same memory, but the contents of
the transfer is no longer valid to cache. */
if (daemon->srv_save == transfer)
daemon->srv_save = NULL;
free(transfer);
}