]> git.ipfire.org Git - thirdparty/grub.git/commit
kern/disk: Limit recursion depth
authorB Horn <b@horn.uk>
Sun, 12 May 2024 03:09:24 +0000 (04:09 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 23 Jan 2025 15:22:47 +0000 (16:22 +0100)
commit18212f0648b6de7d71d4c8f41eb4d8b78b3a299b
treeab81bf03ae7417f610e0740362ea24616bd071ad
parent67f70f70a36b6e87a65f928fe1e840a12eafb7ae
kern/disk: Limit recursion depth

The grub_disk_read() may trigger other disk reads, e.g. via loopbacks.
This may lead to very deep recursion which can corrupt the heap. So, fix
the issue by limiting reads depth.

Reported-by: B Horn <b@horn.uk>
Signed-off-by: B Horn <b@horn.uk>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/disk.c
include/grub/err.h