changeset 18789:555f61ff9aab

8875 loader.efi: efipart should exclude iPXE stub block protocol
author Toomas Soome <tsoome@me.com>
date Wed, 29 Nov 2017 18:04:01 +0200
parents fecd8df30b1e
children 6ba318060715
files usr/src/boot/sys/boot/efi/libefi/efipart.c
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/boot/sys/boot/efi/libefi/efipart.c	Sun May 28 09:51:41 2017 +0300
+++ b/usr/src/boot/sys/boot/efi/libefi/efipart.c	Wed Nov 29 18:04:01 2017 +0200
@@ -239,6 +239,16 @@
 		    !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);
 }