From 6c6e04f2699a6755d7a29e6fc1679b292600616c Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Wed, 29 Nov 2017 18:04:01 +0200 Subject: [PATCH] 8875 loader.efi: efipart should exclude iPXE stub block protocol Reviewed by: Jason King Approved by: Dan McDonald --- usr/src/boot/sys/boot/efi/libefi/efipart.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/usr/src/boot/sys/boot/efi/libefi/efipart.c b/usr/src/boot/sys/boot/efi/libefi/efipart.c index 347c14f68a..2640201698 100644 --- a/usr/src/boot/sys/boot/efi/libefi/efipart.c +++ b/usr/src/boot/sys/boot/efi/libefi/efipart.c @@ -239,6 +239,16 @@ efipart_hdd(EFI_DEVICE_PATH *dp) !blkio->Media->MediaPresent) { return (false); } + + /* + * We assume the block size 512 or greater power of 2. + * iPXE is known to insert stub BLOCK IO device with + * BlockSize 1. + */ + if (blkio->Media->BlockSize < 512 || + !powerof2(blkio->Media->BlockSize)) { + return (false); + } } return (true); } -- 2.11.4.GIT