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)
committerJerome Forissier <jerome.forissier@linaro.org>
Wed, 22 Oct 2025 12:28:33 +0000 (14:28 +0200)
commit81e5708cc2c865df606e49aed5415adb2a662171
treee3ab086d516eb3d75920f01532d4146f8973e6cf
parent34369d34e413ac32a131dd144b55ad04873e4854
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>
net/bootp.c