fs: Use safe math macros to prevent overflows
authorLidong Chen <lidong.chen@oracle.com>
Tue, 21 Jan 2025 19:02:36 +0000 (19:02 +0000)
committerFelix Zielcke <fzielcke@z-51.de>
Wed, 11 Jun 2025 15:42:34 +0000 (17:42 +0200)
commitefa3052d9d6069f89d007987292a73b77d708be6
treebf89875c3df6defdde36786aa4266f49f474d368
parent97fce97c5478567dd325c54a3e8bb15e69a1315c
fs: 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>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
Conflicts:
grub-core/fs/erofs.c

Gbp-Pq: Topic cve-2025-jan
Gbp-Pq: Name fs-Use-safe-math-macros-to-prevent-overflows.patch
grub-core/fs/archelp.c
grub-core/fs/btrfs.c
grub-core/fs/cpio_common.c
grub-core/fs/f2fs.c
grub-core/fs/ntfscomp.c
grub-core/fs/squash4.c
grub-core/fs/xfs.c