From nobody@FreeBSD.org  Thu Mar  2 12:53:02 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 1F7A016A420
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  2 Mar 2006 12:53:02 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id D388343D45
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  2 Mar 2006 12:53:01 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k22Cr16Z016083
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 2 Mar 2006 12:53:01 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id k22Cr14q016082;
	Thu, 2 Mar 2006 12:53:01 GMT
	(envelope-from nobody)
Message-Id: <200603021253.k22Cr14q016082@www.freebsd.org>
Date: Thu, 2 Mar 2006 12:53:01 GMT
From: Brad Harvell <brad@freebsd.frostbit.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: tcp_timer_2msl_tw NULL pointer dereference panic
X-Send-Pr-Version: www-2.3

>Number:         94020
>Category:       kern
>Synopsis:       [tcp] tcp_timer_2msl_tw NULL pointer dereference panic
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    andre
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Mar 02 13:00:15 GMT 2006
>Closed-Date:    Tue Jun 12 07:30:39 GMT 2007
>Last-Modified:  Tue Jun 12 07:30:39 GMT 2007
>Originator:     Brad Harvell
>Release:        6.0-STABLE
>Organization:
>Environment:
FreeBSD s1.frostbit.org 6.0-STABLE FreeBSD 6.0-STABLE #0: Mon Dec 19 01:16:07 MST 2005     brad@s1.frostbit.org:/usr/obj/usr/src/sys/SIXFOUR  amd64
>Description:
page fault panic in tcp_timer_2msl_tw(), tw->tw_inpcb is dereferenced to NULL.

Pawel Worach reported this problem to the freebsd-net list with
5.4-RELEASE/i386. he included a backtrace which matches up with mine:

http://docs.freebsd.org/cgi/mid.cgi?4330711A.4040808
http://docs.freebsd.org/cgi/mid.cgi?4331F3A3.1060707


Fatal trap 12: page fault while in kernel mode
cpuid = 0; apic id = 00
fault virtual address   = 0x120
fault code              = supervisor write, page not present
instruction pointer     = 0x8:0xffffffff803eb5c8
stack pointer           = 0x10:0xffffffffb3b64b00
frame pointer           = 0x10:0x4
code segment            = base 0x0, limit 0xfffff, type 0x1b
                        = DPL 0, pres 1, long 1, def32 0, gran 1
processor eflags        = interrupt enabled, resume, IOPL = 0
current process         = 109 (swi4: clock sio)
trap number             = 12
panic: page fault
cpuid = 0


(kgdb) bt
#0  doadump () at pcpu.h:172
#1  0x0000000000000004 in ?? ()
#2  0xffffffff80334087 in boot (howto=260) at /usr/src/sys/kern/kern_shutdown.c:399
#3  0xffffffff80334721 in panic (fmt=0xffffff011f5ea260 "") at /usr/src/sys/kern/kern_shutdown.c:555
#4  0xffffffff804d8f4f in trap_fatal (frame=0xffffff011f5ea260, eva=18446742979019198464) at /usr/src/sys/amd64/amd64/trap.c:660
#5  0xffffffff804d926f in trap_pfault (frame=0xffffffffb3b64a50, usermode=0) at /usr/src/sys/amd64/amd64/trap.c:573
#6  0xffffffff804d9523 in trap (frame=
      {tf_rdi = 37, tf_rsi = -1094690364832, tf_rdx = 352, tf_rcx = 0, tf_r8 = -1094690364832, tf_r9 = -1097703752096, tf_rax = 4, tf_rbx = -1095116425984, tf_rbp = 4, tf_r10 = -1095116423576, tf_r11 = -1099251533776, tf_r12 = 0, tf_r13 = -2138799016, tf_r14 = -2138799008, tf_r15 = 1, tf_trapno = 12, tf_addr = 288, tf_flags = -2138799016, tf_err = 2, tf_rip = -2143373880, tf_cs = 8, tf_rflags = 66183, tf_rsp = -1279898864, tf_ss = 16}) at /usr/src/sys/amd64/amd64/trap.c:352
#7  0xffffffff804c665b in calltrap () at /usr/src/sys/amd64/amd64/exception.S:168
#8  0xffffffff803eb5c8 in tcp_timer_2msl_tw (reuse=0) at atomic.h:142
#9  0xffffffff803eb680 in tcp_slowtimo () at /usr/src/sys/netinet/tcp_timer.c:136
#10 0xffffffff80376517 in pfslowtimo (arg=0x25) at /usr/src/sys/kern/uipc_domain.c:475
#11 0xffffffff803433b5 in softclock (dummy=0x25) at /usr/src/sys/kern/kern_timeout.c:290
#12 0xffffffff8031b315 in ithread_loop (arg=0xffffff0000d06000) at /usr/src/sys/kern/kern_intr.c:547
#13 0xffffffff80319e57 in fork_exit (callout=0xffffffff8031b230 <ithread_loop>, arg=0xffffff0000d06000, frame=0xffffffffb3b64c50)
    at /usr/src/sys/kern/kern_fork.c:789
#14 0xffffffff804c69be in fork_trampoline () at /usr/src/sys/amd64/amd64/exception.S:394
#15 0x0000000000000000 in ?? ()


(kgdb) frame 8
#8  0xffffffff803eb5c8 in tcp_timer_2msl_tw (reuse=0) at atomic.h:142

(kgdb) info loc
tw = (struct tcptw *) 0xffffff0105f97500
tw_tail = (struct tcptw *) 0xffffffff80848460
twl = (struct twlist *) 0xffffffff80848458
i = 1

(kgdb) p *tw
$1 = {tw_inpcb = 0x0, snd_nxt = 2902930442, rcv_nxt = 766179888, iss = 2902880028, irs = 766179299, last_win = 65534,
  tw_so_options = 4, tw_cred = 0x0, t_recent = 0, t_starttime = 18446744073709518933, tw_time = 0, tw_2msl = {
    le_next = 0xffffff000c971c30, le_prev = 0xffffffff80848458}}
>How-To-Repeat:
unknown
>Fix:
unknown
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->andre 
Responsible-Changed-By: andre 
Responsible-Changed-When: Fri Mar 3 21:51:39 UTC 2006 
Responsible-Changed-Why:  
Take over. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94020 

From: Bruce M Simpson <bms@incunabulum.net>
To: freebsd-gnats-submit@FreeBSD.org
Cc: andre@FreeBSD.org
Subject: Re: kern/94020: [tcp] tcp_timer_2msl_tw NULL pointer dereference
 panic
Date: Mon, 25 Sep 2006 20:04:33 +0100

 Didn't this get fixed by mohans in tcp_timer.c rev 1.82 ?
State-Changed-From-To: open->feedback 
State-Changed-By: glebius 
State-Changed-When: Sat Oct 14 11:39:50 UTC 2006 
State-Changed-Why:  
Is the problem reproducible on latest RELENG_6? There was 
some work done in this area. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94020 
State-Changed-From-To: feedback->closed 
State-Changed-By: linimon 
State-Changed-When: Tue Jun 12 07:29:52 UTC 2007 
State-Changed-Why:  
Feedback timeout (> 6 months). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=94020 
>Unformatted:
