]> git.ipfire.org Git - thirdparty/grub.git/commit
disk/diskfilter: Don't make a RAID array with more than 1024 disks
authorDaniel Axtens <dja@axtens.net>
Wed, 19 Oct 2022 09:23:22 +0000 (20:23 +1100)
committerDaniel Kiper <daniel.kiper@oracle.com>
Thu, 27 Oct 2022 18:10:18 +0000 (20:10 +0200)
commit2a5e3c1f2aed88c2289fb595da8308e898b87915
tree3e511b4e8f9a3647067e2666bb2bf48484c137a3
parent93afdf859743177369fe8669fff78da29e7d4e01
disk/diskfilter: Don't make a RAID array with more than 1024 disks

This is "belt and braces" with commit 12e20a6a695f (disk/diskfilter:
Check calloc() result for NULL): we end up trying to use too much memory
in situations like corrupted Linux software RAID setups purporting to
use a huge number of disks. Simply refuse to permit such configurations.

1024 is a bit arbitrary, yes, and I feel a bit like I'm tempting fate
here, but I think 1024 disks in an array (that GRUB has to read to boot!)
should be enough for anyone.

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