Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Aug 2009 10:22:07 GMT
From:      Patroklos Argyroudis <argp@census-labs.com>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   kern/138381: NULL pointer dereference in t3_set_tcb_field() in file sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c
Message-ID:  <200908311022.n7VAM7ab064742@www.freebsd.org>
Resent-Message-ID: <200908311030.n7VAU4D7029194@freefall.freebsd.org>

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

>Number:         138381
>Category:       kern
>Synopsis:       NULL pointer dereference in t3_set_tcb_field() in file sys/dev/cxgb/ulp/tom/cxgb_cpl_io.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 10:30:04 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 t3_set_tcb_field() line 895 in file sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c. The dereference should be after the check against NULL in line 897.
>How-To-Repeat:
N/A
>Fix:
Patch attached.

Patch attached with submission follows:

--- ./sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c.orig	2009-08-28 15:12:33.000000000 +0300
+++ ./sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c	2009-08-28 15:27:38.000000000 +0300
@@ -892,10 +892,12 @@
 t3_set_tcb_field(struct toepcb *toep, uint16_t word, uint64_t mask, uint64_t val)
 {
 	struct mbuf *m;
-	struct tcpcb *tp = toep->tp_tp;
+	struct tcpcb *tp;
 	
 	if (toep == NULL)
 		return;
+
+	tp = toep->tp_tp;
  
 	if (tp->t_state == TCPS_CLOSED || (toep->tp_flags & TP_ABORT_SHUTDOWN)) {
 		printf("not seting field\n");


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



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