NetBSD-Bugs archive

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

kern/38541: a simple leakage in rtl8169.c rev1.102



>Number:         38541
>Category:       kern
>Synopsis:       a simple leakage in rtl8169.c rev1.102
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 29 13:30:00 +0000 2008
>Originator:     HITOSHI OSADA
>Release:        current (20080429)
>Organization:
>Environment:
NetBSD amd690g 4.99.62 NetBSD 4.99.62 (AMD690G) #6: Tue Apr 29 20:31:26 JST 
2008  root@amd690g:/NetBSD-obj/src-obj/sys/arch/amd64/compile/AMD690G amd64
>Description:
A simple leakage for ``Split device_t/softc'' cause uvm_fault in mii_attach().

>How-To-Repeat:
boot a machine that has re(4).
>Fix:
Index: rtl8169.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ic/rtl8169.c,v
retrieving revision 1.102
diff -u -r1.102 rtl8169.c
--- rtl8169.c   25 Apr 2008 11:27:19 -0000      1.102
+++ rtl8169.c   29 Apr 2008 11:47:48 -0000
@@ -187,9 +187,9 @@
 }

 static int
-re_gmii_readreg(struct device *self, int phy, int reg)
+re_gmii_readreg(device_t dev, int phy, int reg)
 {
-       struct rtk_softc *sc = (void *)self;
+       struct rtk_softc *sc = device_private(dev);
        uint32_t rval;
        int i;



Home | Main Index | Thread Index | Old Index