net: bootp: Prevent buffer overflow to avoid leaking the RAM content
authorPaul HENRYS <paul.henrys_ext@softathome.com>
Thu, 9 Oct 2025 15:43:28 +0000 (17:43 +0200)
committerAndreas Henriksson <andreas@fatal.se>
Tue, 23 Jun 2026 19:07:40 +0000 (21:07 +0200)
commit0dd6acec674d01d31964470c325b182333f63308
treecbbfaed1918635d71de40bcdc20b877f8241a85b
parent567d84447c01010df56b81b509c5cf1b70083586
net: bootp: Prevent buffer overflow to avoid leaking the RAM content

CVE-2024-42040 describes a possible buffer overflow when calling
bootp_process_vendor() in bootp_handler() since the total length
of the packet is passed to bootp_process_vendor() without being
reduced to len-(offsetof(struct bootp_hdr,bp_vend)+4).

The packet length is also checked against its minimum size to avoid
reading data from struct bootp_hdr outside of the packet length.

Signed-off-by: Paul HENRYS <paul.henrys_ext@softathome.com>
Signed-off-by: Philippe Reynes <philippe.reynes@softathome.com>
(cherry picked from commit 81e5708cc2c865df606e49aed5415adb2a662171)

Gbp-Pq: Name CVE-2024-42040.patch
net/bootp.c