Author: tsoome
Date: Fri Dec  1 06:37:12 2017
New Revision: 326421
URL: https://svnweb.freebsd.org/changeset/base/326421

Log:
  loader.efi: efipart should exclude iPXE stub block protocol
  
  iPXE does insert stub  BLOCK IO protocol handle to rework other issues,
  this handle is not usable as it does not provide actual implementation.
  
  We can detect this situation by checking and validating the BlockSize
  property, so this update does make sure we have BlockSize at least 512B
  and its value is power of 2.
  
  PR:           223969
  Reported by:  Jeff Pieper
  Reviewed by:  imp
  Differential Revision:        https://reviews.freebsd.org/D13297

Modified:
  head/stand/efi/libefi/efipart.c

Modified: head/stand/efi/libefi/efipart.c
==============================================================================
--- head/stand/efi/libefi/efipart.c     Fri Dec  1 05:57:05 2017        
(r326420)
+++ head/stand/efi/libefi/efipart.c     Fri Dec  1 06:37:12 2017        
(r326421)
@@ -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);
 }
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to