]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
stand/common/disk.c: Read partition table relative to the start of the disk
authorAllan Jude <allanjude@FreeBSD.org>
Mon, 2 Jul 2018 18:19:08 +0000 (18:19 +0000)
committerAllan Jude <allanjude@FreeBSD.org>
Mon, 2 Jul 2018 18:19:08 +0000 (18:19 +0000)
commit32c52b48472d3d6a6e678b372c6de96417d1e28d
tree184d6a60e5dbe7eff08e5ec6a488eaa43ec34da6
parent1b09d9df3d08f21c3815e388489c58c2f870812d
stand/common/disk.c: Read partition table relative to the start of the disk

If a disk is of an oddball size, like the 200mb + 512b used in rootgen.sh,
when disk_open() is called on a GELI encrypted partition, attempts to read
the partition table fail, as they pass through the decryption process which
turns the already plaintext data into jibberish.

When reading the partition table, always pass a slice and partition setting
of -1, and an offset of 0. Setting the slice to -1 prevents a false
positive when checking the slice against the cache of GELI encrypted
slices.

Reviewed by: imp, ian
Sponsored by: Klara Systems
Differential Revision: https://reviews.freebsd.org/D15847
stand/common/disk.c