Panic in propagate_priority() [5.3-BETA2]

Robert Watson rwatson at freebsd.org
Thu Sep 2 13:20:45 PDT 2004


On Thu, 2 Sep 2004, Patrick Guelat wrote:

> On Thu, 2 Sep 2004, Robert Watson wrote:
> 
> >> exclusive sleep mutex rip r=1 (0xc079e70c) locked @ /usr/src53/sys/netinet6/raw_ip.c:255
> >
> > Ah, indeed, there's an incorrect "lock" instead of "unlock" there.  Could
> > you try the attached patch:
> 
> Thanks. Your patch works like a dream. I looked a that line a dozen
> times and didn't realize it was a lock instead of an unlock ;-)

Great -- I've merged to HEAD and will merge to RELENG_5 in a couple of
days once it has settled.

> I was just wondering why you're using the same lock in IPv4 and IPv6 and
> if this probably may cause problems in ipv6 over ipv4 situations.

This was a design choice I inherited from those working on the network
stack locking previously, but it actually makes some amount of sense: the
IPv4 and IPv6 implementations share a lot of infrastructure, including
protocol control blocks lists for most protocols.  I.e., UDP, TCP, et al. 
This includes raw IP sockets.  Since the same structures are use, the same
locks must also be used.  I agree there are potential layering issues,
especially relating to IPv4/IPv6 tunneling, which may already be addressed
by queued dispatch (i.e., asynchronous processing of the tunneled packet
to avoid both lock orders and general recursion problems).

Thanks!

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert at fledge.watson.org      Principal Research Scientist, McAfee Research



> 
> Tested on RELENG_5
> 
> -Patrick
> 
> >
> > Index: raw_ip6.c
> > ===================================================================
> > RCS file: /data/fbsd-cvs/ncvs/src/sys/netinet6/raw_ip6.c,v
> > retrieving revision 1.45
> > diff -u -r1.45 raw_ip6.c
> > --- raw_ip6.c	12 Aug 2004 18:31:36 -0000	1.45
> > +++ raw_ip6.c	2 Sep 2004 12:55:19 -0000
> > @@ -252,7 +252,7 @@
> > 		}
> > 		ip6stat.ip6s_delivered--;
> > 	}
> > -	INP_INFO_RLOCK(&ripcbinfo);
> > +	INP_INFO_RUNLOCK(&ripcbinfo);
> > 	return IPPROTO_DONE;
> > }
> --
> Patrick Guélat, ImproWare AG Network Services, CH-4133 Pratteln
> Mail: Patrick.Guelat at imp.ch - Phone: +41 61 826 93 00 (ext: 13)



More information about the freebsd-current mailing list