]> git.ipfire.org Git - thirdparty/grub.git/commit
disk/lvm: Don't blast past the end of the circular metadata buffer
authorDaniel Axtens <dja@axtens.net>
Thu, 21 Jan 2021 07:19:51 +0000 (18:19 +1100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:18 +0000 (15:54 +0100)
commit27a79bf38e6d050e497eb96a3fdddce43af25577
tree63eb4ec30ffea81a2156af0dc8ac296105ab294e
parenta8cc95de74ccc3ad090e8062ac335c844f13c9f4
disk/lvm: Don't blast past the end of the circular metadata buffer

This catches at least some OOB reads, and it's possible I suppose that
if 2 * mda_size is less than GRUB_LVM_MDA_HEADER_SIZE it might catch some
OOB writes too (although that hasn't showed up as a crash in fuzzing yet).

It's a bit ugly and I'd appreciate better suggestions.

Signed-off-by: Daniel Axtens <dja@axtens.net>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/disk/lvm.c