net: Use safe math macros to prevent overflows
authorLidong Chen <lidong.chen@oracle.com>
Wed, 22 Jan 2025 18:04:42 +0000 (18:04 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
commit385d28ecf7076ba93b952a72b3dc5b3e5db76b5a
treed5c02a87e40fdc656ff88cade485769a92f8921b
parent9c52a282297a80fcb60e2b087d1b360677d48ce9
net: Use safe math macros to prevent overflows

Replace direct arithmetic operations with macros from include/grub/safemath.h
to prevent potential overflow issues when calculating the memory sizes.

Signed-off-by: Lidong Chen <lidong.chen@oracle.com>
Signed-off-by: Alec Brown <alec.r.brown@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Conflicts:
grub-core/net/bootp.c
grub-core/net/net.c

Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name net-Use-safe-math-macros-to-prevent-overflows.patch
grub-core/net/bootp.c
grub-core/net/dns.c
grub-core/net/drivers/ieee1275/ofnet.c
grub-core/net/net.c