Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/stand/efiboot MI efiboot: avoid LBA overflow in efi_bloc...



details:   https://anonhg.NetBSD.org/src/rev/c31c15b3a98e
branches:  trunk
changeset: 433442:c31c15b3a98e
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Fri Sep 14 21:37:03 2018 +0000

description:
MI efiboot: avoid LBA overflow in efi_block_find_partitions_disklabel()

diffstat:

 sys/stand/efiboot/efiblock.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 974a4a93d13f -r c31c15b3a98e sys/stand/efiboot/efiblock.c
--- a/sys/stand/efiboot/efiblock.c      Fri Sep 14 20:53:49 2018 +0000
+++ b/sys/stand/efiboot/efiblock.c      Fri Sep 14 21:37:03 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: efiblock.c,v 1.2 2018/08/27 09:51:32 jmcneill Exp $ */
+/* $NetBSD: efiblock.c,v 1.3 2018/09/14 21:37:03 jakllsch Exp $ */
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
@@ -115,7 +115,7 @@
        if (!buf)
                return ENOMEM;
 
-       lba = ((start + LABELSECTOR) * DEV_BSIZE) / bdev->bio->Media->BlockSize;
+       lba = (((EFI_LBA)start + LABELSECTOR) * DEV_BSIZE) / bdev->bio->Media->BlockSize;
        status = uefi_call_wrapper(bdev->bio->ReadBlocks, 5, bdev->bio, bdev->media_id, lba, sz, buf);
        if (EFI_ERROR(status) || getdisklabel(buf, &d) != NULL) {
                FreePool(buf);



Home | Main Index | Thread Index | Old Index