]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
boot1.efi: can't boot from ZFS on 4kn HDD
authortsoome <tsoome@FreeBSD.org>
Wed, 15 Mar 2017 19:48:22 +0000 (19:48 +0000)
committertsoome <tsoome@FreeBSD.org>
Wed, 15 Mar 2017 19:48:22 +0000 (19:48 +0000)
commit69ec1e5fdf38c3a4b94e8ac155469544381e22e2
treeb2f6cbd3593f5b89497fa34e7c2d8b9a1d41bc5d
parent12ad4b9b06f49d359928f1256e7a8824bfc62165
boot1.efi: can't boot from ZFS on 4kn HDD

The boot1.efi immediate issue from PR216964 is that we are reading into
too small buffer, from UEFI spec 2.6:

The size of the Buffer in bytes. This must be a multiple of the intrinsic block size of the device.

The secondary issue is that LBA calculation does not check reminder from
division.

This fix does check the provided buffer size and if we read less than
media sector size or the read offset is not aligned to sector boundary,
we allocate bounce buffer and perform the read by single sector.

PR: 216964
Reported by: Sergey Kozlov
Reviewed by: allanjude, Sergey Kozlov
Approved by: allanjude (mentor)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D9870
sys/boot/efi/boot1/zfs_module.c