]> git.ipfire.org Git - thirdparty/grub.git/commit
disk/lvm: Don't go beyond the end of the data we read from disk
authorDaniel Axtens <dja@axtens.net>
Thu, 21 Jan 2021 06:59:14 +0000 (17:59 +1100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Mar 2021 14:54:18 +0000 (15:54 +0100)
commita8cc95de74ccc3ad090e8062ac335c844f13c9f4
treec14ecf6ef6aea6f555234ccc593db03ab81f6e37
parentb5a2b59cc5b8f5ee7ba3b951e7693e402d5b3a6f
disk/lvm: Don't go beyond the end of the data we read from disk

We unconditionally trusted offset_xl from the LVM label header, even if
it told us that the PV header/disk locations were way off past the end
of the data we read from disk.

Require that the offset be sane, fixing an OOB read and crash.

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