summaryrefslogtreecommitdiff
path: root/sys/kern/subr_disk.c
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2021-06-13 13:18:00 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2021-06-13 13:18:00 +0000
commitd73b8230ffd7ab6b64649e9b401b0c3d30057490 (patch)
tree28836ee51b202014c828b3e7ce1eb81ee2f506e3 /sys/kern/subr_disk.c
parent2f5b5718bdebb201234b2f184be66ac5f1beb329 (diff)
Back off a couple of the more paranoid checks while spoofing GPT
partitions into the disklabel. First, since the alt header is never accessed there is no need to worry about it being inaccessible. Second, the GPT header claiming to cover more sectors than the device has is no reason to ignore all the partitions. The partition actually present could still be useful. Issues encountered in the wild by mlarkin@ while accessing some disk images. ok deraadt@
Diffstat (limited to 'sys/kern/subr_disk.c')
-rw-r--r--sys/kern/subr_disk.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/kern/subr_disk.c b/sys/kern/subr_disk.c
index 4e454aefec5..64ddf136069 100644
--- a/sys/kern/subr_disk.c
+++ b/sys/kern/subr_disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: subr_disk.c,v 1.244 2021/06/02 22:44:27 krw Exp $ */
+/* $OpenBSD: subr_disk.c,v 1.245 2021/06/13 13:17:59 krw Exp $ */
/* $NetBSD: subr_disk.c,v 1.17 1996/03/16 23:17:08 christos Exp $ */
/*
@@ -650,7 +650,6 @@ gpt_chk_hdr(struct gpt_header *gh, struct disklabel *lp)
return (EINVAL);
if (ghlbastart >= DL_GETDSIZE(lp) ||
- ghlbaend >= DL_GETDSIZE(lp) ||
ghpartlba >= DL_GETDSIZE(lp))
return (EINVAL);
@@ -671,11 +670,6 @@ gpt_chk_hdr(struct gpt_header *gh, struct disklabel *lp)
return (EINVAL);
}
- if (letoh64(gh->gh_lba_alt) >= DL_GETDSIZE(lp)) {
- DPRINTF("alternate header's position is bogus\n");
- return (EINVAL);
- }
-
return 0;
}