Don't ignore a GPT that claims the last usable LBA is located
authorkrw <krw@openbsd.org>
Sun, 13 Jun 2021 13:48:00 +0000 (13:48 +0000)
committerkrw <krw@openbsd.org>
Sun, 13 Jun 2021 13:48:00 +0000 (13:48 +0000)
commit7345db1e037eb7976ae248bad3142f661d7dfa70
treead2b5f65fb405ab0c086e6377e980255e37f430e
parent45d66dc9b1b389f60549a9ef4a075ff4fe1f576c
Don't ignore a GPT that claims the last usable LBA is located
past the address where alternate partition entries would be
written.

Just adjust the GPT header value (gh_lba_end) to the highest safe
value and carry on.

Issue encountered in the wild by mlarkin@ while accessing some
disk images.

ok deraadt@
sbin/fdisk/gpt.c