kern/138390: NULL pointer dereference in gif_input() in file sys/net/if_gif.c

Patroklos Argyroudis argp at census-labs.com
Mon Aug 31 11:30:06 UTC 2009


>Number:         138390
>Category:       kern
>Synopsis:       NULL pointer dereference in gif_input() in file sys/net/if_gif.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Aug 31 11:30:05 UTC 2009
>Closed-Date:
>Last-Modified:
>Originator:     Patroklos Argyroudis
>Release:        8.0-CURRENT
>Organization:
census, inc
>Environment:
N/A
>Description:
There is a possible NULL pointer dereference in gif_input() in file sys/net/if_gif.c at line 510.  The check against NULL at line 515 should be before the dereference of ifp at line 510.
>How-To-Repeat:
N/A
>Fix:
Patch attached.

Patch attached with submission follows:

--- ./sys/net/if_gif.c.orig	2009-08-28 16:49:31.000000000 +0300
+++ ./sys/net/if_gif.c	2009-08-28 16:50:59.000000000 +0300
@@ -507,7 +507,7 @@
 	struct ifnet *ifp;
 {
 	int isr, n;
-	struct gif_softc *sc = ifp->if_softc;
+	struct gif_softc *sc;
 	struct etherip_header *eip;
 	struct ether_header *eh;
 	struct ifnet *oldifp;
@@ -518,6 +518,7 @@
 		return;
 	}
 
+	sc = ifp->if_softc;
 	m->m_pkthdr.rcvif = ifp;
 
 #ifdef MAC


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list