From 62ba85c714f686c943420d4683da8b282a629e96 Mon Sep 17 00:00:00 2001 From: YASUOKA Masahiko Date: Fri, 6 May 2016 03:13:53 +0000 Subject: Fix efiboot not to hang with a disk whose block size < 512. Report and diff from Vegar Linge Haaland ok krw --- sys/arch/amd64/stand/efiboot/efidev.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/arch/amd64') diff --git a/sys/arch/amd64/stand/efiboot/efidev.c b/sys/arch/amd64/stand/efiboot/efidev.c index 64dde530543..b0cac089f14 100644 --- a/sys/arch/amd64/stand/efiboot/efidev.c +++ b/sys/arch/amd64/stand/efiboot/efidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efidev.c,v 1.17 2016/05/01 10:43:05 krw Exp $ */ +/* $OpenBSD: efidev.c,v 1.18 2016/05/06 03:13:52 yasuoka Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -88,6 +88,9 @@ efid_io(int rw, efi_diskinfo_t ed, u_int off, int nsect, void *buf) /* block count of the intrisic block size in DEV_BSIZE */ blks = EFI_BLKSPERSEC(ed); + if (blks == 0) + /* block size < 512. HP Stream 13 actually has such a disk. */ + return (EFI_UNSUPPORTED); lba = off / blks; /* leading and trailing unaligned blocks in intrisic block */ -- cgit v1.2.3