Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 31 Dec 2003 10:27:36 -0800 (PST)
From:      Chris McKenzie <cjmckenzie@ucdavis.edu>
To:        Peter Pentchev <roam@ringlet.net>
Cc:        Kris Kennaway <kris@obsecurity.org>
Subject:   Re: How to hard lock FreeBSD-5.1 generic with sl
Message-ID:  <Pine.GSO.4.44.0312311020560.1090-100000@veni.ucdavis.edu>
In-Reply-To: <20031231153028.GA901@straylight.m.ringlet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
I will gladly do so.  HOWEVER, it also appears that sl itself is not
working.  I get a
ifconfig: SIOCIFCREATE: Invalid argument
if I just try
#ifconfig sl0 create.
If I do a
#slattach -s 115200 -l /dev/cuaa1
Then a ifconfig sl0 create . . . I get the same problem.  It is
_also_ worth noting that SL(4) is out of date and does not pertain to the
5.x series.  This problem persists independent of how I have
configured my kernel (since I have tried a few different
configurations) and the system it is running on. However,
I will definitely do the patch and see what happens from there.

On Wed, 31 Dec 2003, Peter Pentchev wrote:

> On Tue, Dec 30, 2003 at 04:28:00PM +0200, Peter Pentchev wrote:
> > On Tue, Dec 30, 2003 at 06:12:53AM -0800, Kris Kennaway wrote:
> > > On Mon, Dec 29, 2003 at 06:02:45PM -0800, Chris McKenzie wrote:
> > > > On three machines (PII 450, P3 450, Pentium laptop 200) with FreeBSD-5.1
> > > > generic (and specific builds) I am able to completely hard lock the system
> > > > by doing the following
> > > >
> > > > # ifconfig ppp0 create
> > > > # ifconfig sl0 create
> > > >
> > > > Heh . . . that shouldn't happen.
> > >
> > > Does the problem persist with 5.2?
> >
> > I just tested in on a 5.2-CURRENT as of today, and yes, the system
> > locked up solid - no ddb, no anything.  I'll try to do some more testing
> > as time permits.
>
> [cc'd to -net for a pre-commit review / discussion]
>
> OK, I think I've found the problem.  The if_clone_attach() routine in
> src/sys/net/if.c blindly adds the new cloned interface to the if_cloners
> list without checking if it is already on the list.  This,
> understandably, leads to problems when trying to attach an interface
> that already exists - such as a ppp interface.
>
> The if_ppp code adds itself to the if_cloners list at the module
> loading stage.  Thus, the very first invocation of ifconfig ppp0 create
> adds the ppp_cloner structure to the list *again* - and creates a loop
> on the list.  Any attempts to traverse the list later lead to lock-ups.
>
> Attached is a patch that does two things: first, only adds the interface
> to the list if it is not already there (the second and third chunks, at
> lines 812 and 827 of if.c), and second, adds a if_check_cloners_loop()
> routine to traverse the if_cloners list and panic if a loop is found.
> The if_check_cloners_loop() invocations could be protected by
> INVARIANTS, KASSERT, or WITNESS, but it sure helps find such problems :)
>
> Chris, could you try this patch and see if it helps in your situation?
>
> And.. happy New Year, everyone! (albeit a little early :)
>
> G'luck,
> Peter
>
> --
> Peter Pentchev	roam@ringlet.net    roam@sbnd.net    roam@FreeBSD.org
> PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
> Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
> I am not the subject of this sentence.
>

Sincerely,
	Christopher J. McKenzie
	cjm@ucdavis.edu



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.44.0312311020560.1090-100000>