Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Aug 2009 11:23:19 GMT
From:      Patroklos Argyroudis <argp@census-labs.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/138390: NULL pointer dereference in gif_input() in file sys/net/if_gif.c
Message-ID:  <200908311123.n7VBNJu1013609@www.freebsd.org>
Resent-Message-ID: <200908311130.n7VBU6KD094195@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908311123.n7VBNJu1013609>