]> git.ipfire.org Git - thirdparty/grub.git/commit
kern/efi/mm: Detect calls to grub_efi_drop_alloc() with wrong page counts
authorMate Kukri <mate.kukri@canonical.com>
Wed, 12 Jun 2024 15:14:21 +0000 (16:14 +0100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 20 Jun 2024 13:34:38 +0000 (15:34 +0200)
commit55d35d62831af122fadf33c4bc8cd53aada949cb
treefb2dc5ae6e505d5d0c89550f319d702904ceecbd
parent61f1d0a612a01c2f48f718ff04590ff481e028f8
kern/efi/mm: Detect calls to grub_efi_drop_alloc() with wrong page counts

Silently keeping entries in the list if the address matches, but the
page count doesn't is a bad idea, and can lead to double frees.

grub_efi_free_pages() have already freed parts of this block by this
point, and thus keeping the whole block in the list and freeing it again
at exit can lead to double frees.

Signed-off-by: Mate Kukri <mate.kukri@canonical.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/kern/efi/mm.c