Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix buffer overflow, detected by kASan.



details:   https://anonhg.NetBSD.org/src/rev/536e43e72f90
branches:  trunk
changeset: 365599:536e43e72f90
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu Aug 23 11:53:15 2018 +0000

description:
Fix buffer overflow, detected by kASan.

[    1.044878] kASan: Unauthorized Access In 0xffffffff804ec7e2: Addr 0xffffffff818a51e4 [2 bytes, read]
[    1.044878] #0 0xffffffff804ec7e2 in mskc_probe <netbsd>
[    1.044878] #1 0xffffffff80e92a77 in mapply <netbsd>
[    1.044878] #2 0xffffffff80e92e5f in config_search_loc <netbsd>
[    1.044878] #3 0xffffffff80e93fb5 in config_found_sm_loc <netbsd>
[    1.044878] #4 0xffffffff802ca9ea in pci_probe_device <netbsd>
[    1.044878] #5 0xffffffff802cad97 in pci_enumerate_bus <netbsd>
[    1.044878] #6 0xffffffff802caf00 in pcirescan <netbsd>
[    1.044878] #7 0xffffffff802cb1ee in pciattach <netbsd>
[    1.044878] #8 0xffffffff80e93e5b in config_attach_loc <netbsd>
[    1.044878] #9 0xffffffff80e93fce in config_found_sm_loc <netbsd>
[    1.044878] #10 0xffffffff80271212 in mp_pci_scan <netbsd>
[    1.044878] #11 0xffffffff8022d9ee in mainbus_attach <netbsd>
[    1.044878] #12 0xffffffff80e93e5b in config_attach_loc <netbsd>
[    1.044878] #13 0xffffffff8021e38b in cpu_configure <netbsd>
[    1.044878] #14 0xffffffff814a7068 in main <netbsd>

diffstat:

 sys/dev/pci/if_msk.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r e3be8359c0da -r 536e43e72f90 sys/dev/pci/if_msk.c
--- a/sys/dev/pci/if_msk.c      Thu Aug 23 06:21:37 2018 +0000
+++ b/sys/dev/pci/if_msk.c      Thu Aug 23 11:53:15 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_msk.c,v 1.75 2018/07/10 20:48:54 jdolecek Exp $ */
+/* $NetBSD: if_msk.c,v 1.76 2018/08/23 11:53:15 maxv Exp $ */
 /*     $OpenBSD: if_msk.c,v 1.79 2009/10/15 17:54:56 deraadt Exp $     */
 
 /*
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.75 2018/07/10 20:48:54 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1.76 2018/08/23 11:53:15 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -195,7 +195,8 @@
        { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_C036 },
        { PCI_VENDOR_MARVELL,           PCI_PRODUCT_MARVELL_YUKON_C042 },
        { PCI_VENDOR_SCHNEIDERKOCH,     PCI_PRODUCT_SCHNEIDERKOCH_SK_9SXX },
-       { PCI_VENDOR_SCHNEIDERKOCH,     PCI_PRODUCT_SCHNEIDERKOCH_SK_9E21 }
+       { PCI_VENDOR_SCHNEIDERKOCH,     PCI_PRODUCT_SCHNEIDERKOCH_SK_9E21 },
+       { 0,                            0 }
 };
 
 static inline u_int32_t



Home | Main Index | Thread Index | Old Index