Summary: | [PATCH] boot1.efi UEFI system table corruption | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Chris Ruffin <cmruffin> | ||||
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Some People | CC: | ambrisko, cmruffin, emaste | ||||
Priority: | --- | Keywords: | uefi | ||||
Version: | 10.1-RELEASE | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Chris Ruffin
2015-02-21 16:51:33 UTC
Created attachment 153375 [details]
patch which resolves disagreement on block size
ufsread.c assumes a device block size of 512 in all calls to dskread() which is implemented in boot1.c. This patch causes dskread() to follow that same assumption.
Looks like this was fixed in a slightly different way on HEAD, to support 4Kn drives, here: https://svnweb.freebsd.org/base?view=revision&revision=273865 (or git 37cb22f7) That change also divides lba by bootdev->Media->BlockSize / DEV_BSIZE - i.e., by 4 for CDs and by 8 for 4Kn. I reviewed this change and agree it is equivalent / more complete fix. A commit references this bug: Author: emaste Date: Tue Feb 24 22:11:08 UTC 2015 New revision: 279254 URL: https://svnweb.freebsd.org/changeset/base/279254 Log: MFC part of r273865: fix boot1.efi for block size != 512 r273865 is part of the work for supporting 4Kn drives, but it turns out the underlying bug can actually cause corruption of the UEFI system table in any case where block size is not 512. Relevant portion of the original commit message: convert boot1.efi to corrrectly calculate the lba for what the media reports and convert the size based on what FreeBSD uses. existing code would use the 512 byte lba and convert the using 4K byte size. PR: 197881 Reviewed by: Chris Ruffin Changes: stable/10/sys/boot/amd64/boot1.efi/boot1.c Resolved with partial merge of r273865 |