Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Sep 2004 16:18:05 -0400 (EDT)
From:      Robert Watson <rwatson@freebsd.org>
To:        Patrick Guelat <pg@imp.ch>
Cc:        freebsd-current@freebsd.org
Subject:   Re: Panic in propagate_priority() [5.3-BETA2]
Message-ID:  <Pine.NEB.3.96L.1040902161530.58119C-100000@fledge.watson.org>
In-Reply-To: <20040902211406.I19478@murphy.imp.ch>

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

On Thu, 2 Sep 2004, Patrick Guelat wrote:

> On Thu, 2 Sep 2004, Robert Watson wrote:
>=20
> >> exclusive sleep mutex rip r=3D1 (0xc079e70c) locked @ /usr/src53/sys/n=
etinet6/raw_ip.c:255
> >
> > Ah, indeed, there's an incorrect "lock" instead of "unlock" there.  Cou=
ld
> > you try the attached patch:
>=20
> 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.=
=20
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@fledge.watson.org      Principal Research Scientist, McAfee Research



>=20
> Tested on RELENG_5
>=20
> -Patrick
>=20
> >
> > Index: raw_ip6.c
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > 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=0912 Aug 2004 18:31:36 -0000=091.45
> > +++ raw_ip6.c=092 Sep 2004 12:55:19 -0000
> > @@ -252,7 +252,7 @@
> > =09=09}
> > =09=09ip6stat.ip6s_delivered--;
> > =09}
> > -=09INP_INFO_RLOCK(&ripcbinfo);
> > +=09INP_INFO_RUNLOCK(&ripcbinfo);
> > =09return IPPROTO_DONE;
> > }
> --
> Patrick Gu=E9lat, ImproWare AG Network Services, CH-4133 Pratteln
> Mail: Patrick.Guelat@imp.ch - Phone: +41 61 826 93 00 (ext: 13)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1040902161530.58119C-100000>