]> git.ipfire.org Git - thirdparty/grub.git/commit
relocator: Protect grub_relocator_alloc_chunk_addr() input args against integer under...
authorAlexey Makhalov <amakhalov@vmware.com>
Wed, 15 Jul 2020 06:42:37 +0000 (06:42 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 29 Jul 2020 14:55:48 +0000 (16:55 +0200)
commitcaea56d1f8fa1ae298936f8d75b220e7f12b73d3
treef3a9286f1debfbc2403ec3b379a0ae2a982cd4d9
parent781b3e5efc35c17cbce95393aafd63a5b429f9e6
relocator: Protect grub_relocator_alloc_chunk_addr() input args against integer underflow/overflow

Use arithmetic macros from safemath.h to accomplish it. In this commit,
I didn't want to be too paranoid to check every possible math equation
for overflow/underflow. Only obvious places (with non zero chance of
overflow/underflow) were refactored.

Signed-off-by: Alexey Makhalov <amakhalov@vmware.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/loader/i386/linux.c
grub-core/loader/i386/pc/linux.c
grub-core/loader/i386/xen.c
grub-core/loader/xnu.c