Module Name: src
Committed By: msaitoh
Date: Mon Aug 22 08:35:42 UTC 2016
Modified Files:
src/sys/dev/pci: pci_subr.c
Log Message:
Don't follow an incorrect pointer in an extended capability header. Tested
with Super Micro X10SDV-8C-TLN4F bus 255, device 12, function 0 (BIOS 1.1b).
To generate a diff of this commit:
cvs rdiff -u -r1.149 -r1.150 src/sys/dev/pci/pci_subr.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/pci_subr.c
diff -u src/sys/dev/pci/pci_subr.c:1.149 src/sys/dev/pci/pci_subr.c:1.150
--- src/sys/dev/pci/pci_subr.c:1.149 Wed Aug 17 06:32:01 2016
+++ src/sys/dev/pci/pci_subr.c Mon Aug 22 08:35:42 2016
@@ -1,4 +1,4 @@
-/* $NetBSD: pci_subr.c,v 1.149 2016/08/17 06:32:01 msaitoh Exp $ */
+/* $NetBSD: pci_subr.c,v 1.150 2016/08/22 08:35:42 msaitoh Exp $ */
/*
* Copyright (c) 1997 Zubin D. Dittia. All rights reserved.
@@ -40,7 +40,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.149 2016/08/17 06:32:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pci_subr.c,v 1.150 2016/08/22 08:35:42 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_pci.h"
@@ -3490,6 +3490,10 @@ pci_conf_print_extcaplist(
off = PCI_EXTCAPLIST_NEXT(rval);
if (off == 0)
break;
+ else if (off <= PCI_CONF_SIZE) {
+ printf(" next pointer: 0x%03x (incorrect)\n", off);
+ return;
+ }
rval = regs[o2i(off)];
}