From owner-freebsd-current@FreeBSD.ORG Tue Mar 2 16:58:13 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 1621916A4CE for ; Tue, 2 Mar 2004 16:58:13 -0800 (PST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id A50ED43D1F for ; Tue, 2 Mar 2004 16:58:12 -0800 (PST) (envelope-from max@love2party.net) Received: from [212.227.126.206] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1AyKiC-000691-00 for current@freebsd.org; Wed, 03 Mar 2004 01:58:12 +0100 Received: from [217.227.153.50] (helo=vampire.homelinux.org) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1AyKiA-0001u4-00 for current@freebsd.org; Wed, 03 Mar 2004 01:58:11 +0100 Received: (qmail 15352 invoked from network); 3 Mar 2004 01:04:49 -0000 Received: from unknown (HELO fbsd52.laiers.local) (192.168.4.88) by 192.168.4.1 with SMTP; 3 Mar 2004 01:04:49 -0000 From: Max Laier To: Simon Coggins , current@freebsd.org Date: Wed, 3 Mar 2004 01:58:06 +0100 User-Agent: KMail/1.5.4 References: <20040302223305.GA12935@uow.edu.au> In-Reply-To: <20040302223305.GA12935@uow.edu.au> MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_e2SRAowAWXRIihV" Message-Id: <200403030158.06151.max@love2party.net> X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:e28873fbe4dbe612ce62ab869898ff08 cc: Bruce M Simpson Subject: Re: Kernel panic when setting up queues via IPFW X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2004 00:58:13 -0000 --Boundary-00=_e2SRAowAWXRIihV Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tuesday 02 March 2004 23:33, Simon Coggins wrote: > Hi, > > I've just started playing with queues and pipes and I created the > config attached. The problem is when ever I reconfigure queue 6 (I was > doing my numbering wrong to start with hence i found it) the kernel > panics. I can reproduce it everytime on my machine. it was reproducible and attached patch fixed it for me. There were some missing unlocks on the dummynet mutex for error cases. Can you check, please? Am just lucky that it doesn't seem to be MT_TAG related this time. > The machine is: > FreeBSD router 5.2-CURRENT FreeBSD 5.2-CURRENT #10: Tue Mar 2 04:31:42 > EST 2004 > root@chaotic.chaos.oz.org:/usr/world/obj/usr/world/src/sys/Router i386 > > When the 2nd "queue 6 config pipe 1 ...." command > is issued (the last line), a kernel panic occurs. > > I don't have the debugger currently compiled into the kernel so I > couldn't get usful info. Hopefully someone else can reproduce this. > > The config is: > ------8<------8<-------8<------ > # Default Traffic > add queue 1 ip from any to any in recv tun10 > queue 1 config pipe 1 weight 30 queue 15kb > pipe 1 config bw 512kb/s queue 25kb > > add queue 2 ip from any to any out xmit tun10 > queue 2 config pipe 2 weight 30 queue 15kb > pipe 2 config bw 128kb/s queue 25kb > > # DNS/ntp etc > add queue 3 udp from any to any src-port 53 in recv tun10 > add queue 3 tcp from any to any src-port 54 in recv tun10 > add queue 3 udp from any to any src-port 123 in recv tun10 > queue 3 config pipe 1 weight 100 queue 15kb > > add queue 4 udp from any to any dst-port 53 out xmit tun10 > add queue 4 tcp from any to any dst-port 53 out xmit tun10 > add queue 4 udp from any to any dst-port 123 out xmit tun10 > queue 4 config pipe 2 weight 100 queue 15kb > > # SSH / IRC traffic > add queue 5 tcp from any to any dst-port 22,6667,6666 in recv tun10 > add queue 5 tcp from any to any src-port 22,6667,6666 in recv tun10 > add queue 5 tcp from 130.130.69.5 to any src-port 1 in recv tun10 > queue 5 config pipe 1 weight 90 queue 15kb > > add queue 6 tcp from any to any dst-port 22,6667,6666 out xmit tun10 > add queue 6 tcp from any to any src-port 22,6667,6666 out xmit tun10 > add queue 6 tcp from any to 130.130.69.5 dst-port 1 out xmit tun10 > queue 6 config pipe 2 weight 90 queue 10kb > > # Web Traffic > add queue 5 tcp from any to any src-port 80 in recv tun10 > add queue 5 tcp from any to any dst-port 80 in recv tun10 > queue 5 config pipe 1 weight 40 queue 10kb > > add queue 6 tcp from any to any dst-port 80 out xmit tun10 > add queue 6 tcp from any to any src-port 80 out xmit tun10 > queue 6 config pipe 1 weight 40 queue 10kb > ------8<------8<------8<------- -- Best regards, | mlaier@freebsd.org Max Laier | ICQ #67774661 http://pf4freebsd.love2party.net/ | mlaier@EFnet --Boundary-00=_e2SRAowAWXRIihV Content-Type: text/x-diff; charset="iso-8859-1"; name="ip_dummynet.c.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="ip_dummynet.c.diff" Index: ip_dummynet.c =================================================================== RCS file: /cvsdrop/mlaier/fcvs/src/sys/netinet/ip_dummynet.c,v retrieving revision 1.79 diff -u -r1.79 ip_dummynet.c --- ip_dummynet.c 25 Feb 2004 19:55:28 -0000 1.79 +++ ip_dummynet.c 3 Mar 2004 00:17:17 -0000 @@ -1616,6 +1616,7 @@ if (b == NULL || b->pipe_nr != p->pipe_nr) { /* new pipe */ x = malloc(sizeof(struct dn_pipe), M_DUMMYNET, M_NOWAIT | M_ZERO); if (x == NULL) { + DUMMYNET_UNLOCK(); printf("dummynet: no memory for new pipe\n"); return ENOSPC; } @@ -1664,8 +1665,10 @@ a = b , b = b->next) ; if (b == NULL || b->fs_nr != pfs->fs_nr) { /* new */ - if (pfs->parent_nr == 0) /* need link to a pipe */ + if (pfs->parent_nr == 0) { /* need link to a pipe */ + DUMMYNET_UNLOCK(); return EINVAL ; + } x = malloc(sizeof(struct dn_flow_set), M_DUMMYNET, M_NOWAIT|M_ZERO); if (x == NULL) { DUMMYNET_UNLOCK(); @@ -1681,8 +1684,10 @@ x->weight = 100 ; } else { /* Change parent pipe not allowed; must delete and recreate */ - if (pfs->parent_nr != 0 && b->parent_nr != pfs->parent_nr) + if (pfs->parent_nr != 0 && b->parent_nr != pfs->parent_nr) { + DUMMYNET_UNLOCK(); return EINVAL ; + } x = b; } set_fs_parms(x, pfs); --Boundary-00=_e2SRAowAWXRIihV--