Re: How to hard lock FreeBSD-5.1 generic with sl

From: Chris McKenzie (cjmckenzie_at_ucdavis.edu)
Date: 12/31/03


Date: Wed, 31 Dec 2003 10:27:36 -0800 (PST)
To: Peter Pentchev <roam@ringlet.net>

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

_______________________________________________
freebsd-net@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"



Relevant Pages

  • Re: How to hard lock FreeBSD-5.1 generic with sl
    ... src/sys/net/if.c blindly adds the new cloned interface to the if_cloners ... Any attempts to traverse the list later lead to lock-ups. ... Attached is a patch that does two things: ... routine to traverse the if_cloners list and panic if a loop is found. ...
    (freebsd-net)
  • Re: 2.4, b44 transmit timeout
    ... If i attach the cable then I see the interface coming up, ... ifconfig down/up problems, I believe it fixes the same problem since ... What I believe should happen after applying this patch is that the ... pump might not work even with it (If I understood correctly, ...
    (Linux-Kernel)
  • Re: kern/87506 : [PATCH] Fix alias support on vr interfaces
    ... >> setting an alias on a vr device with ifconfig the alias address ... Without the patch I ... > did just reproduce this on my laptop's rlinterface though. ...
    (freebsd-current)
  • Re: AIX 1.3 Failures and Fables
    ... Found this in #man ifconfig ... " The address family default is DARPA Internet. ... Configures network interface parameters. ...
    (comp.sys.ibm.ps2.hardware)
  • Re: Problem with Bridging ... and bge devices under FreeBSD 7.x?
    ... I'm trying to run a QEMU VM on top of a FreeBSD 7.x server ... ... ifconfig bridge0 destroy ... Using VNC to connect to the VM, I can look at the interface, and it says it is ... So, all I have left is that everything is being setup okay, but there is ...
    (freebsd-net)