diff --git a/stand/efi/libefi/efipart.c b/stand/efi/libefi/efipart.c index 1e161c2bb39d..a5a1a8220604 100644 --- a/stand/efi/libefi/efipart.c +++ b/stand/efi/libefi/efipart.c @@ -257,6 +257,14 @@ efipart_hdd(EFI_DEVICE_PATH *dp) !blkio->Media->MediaPresent) { return (false); } + + /* + * We assume the block size 512 or greater power of 2. + */ + if (blkio->Media->BlockSize < 512 || + !powerof2(blkio->Media->BlockSize)) { + return (false); + } } return (true); }