Bug 27601

Summary: infinite loop at end (?) of ifnet list ...
Product: Base System Reporter: gunther <gunther>
Component: kernAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-RELEASE   
Hardware: Any   
OS: Any   

Description gunther 2001-05-24 01:40:01 UTC
Problem: apparently machine hangs during boot after device
initialization. Turns out that it hangs in the pseudo device
initialization. Peculiar but not unreasonable configuration
makes this problem manifest.

Problem appears (only) if I have only one real ethernet device
with nwip and ef:

device sis
pseudo-device ef
pseudo-device nwip

(The nwip stuff is from Boris Popov of Kazachstan. I moved the 
 if_nwip.c file into /sys/net and added links in /sys/conf/files.net
 etc.)

I am not certain that this is necessarily a problem in if_nwip.c

I went in with the kernel debugger and found the following: if_ef.c
in ef_load() has an iteration through the ifnet list of network
devices to find which are ethernets and then to clone its special
ethernet-frame handlers. This iteration never terminates because
the nwip pseudo-device entry in the ifnet list has a next link that
points back to itself. Since nwip is not an ethernet device, this
iteration "continues" before any resources are allocated or anything
and thus this is just a very fast infinite loop.

While it is suspicious that the infinite loop is around the nwip
entry in the ifnet list, I do not hesitate to bother FreeBSD 
maintainers with this bug for two reasons:

- the ifnet list belongs to the kernel and it should not be allowed
  for a module to insert an infinite loop to this list.

- the problem goes away simply by adding an additional ethernet 
  device probe into the config file. E.g., I just added 

  device fxp0

  behind the sis device even though I don't have an fxp card
  in that machine.

I will upgrade to 4.3 RELEASE and try it again. I will then 
see if I can find anything wrong in the if_nwip.c stuff, if
not I will chime again.
Comment 1 Jesper Skriver freebsd_committer freebsd_triage 2001-05-28 00:40:22 UTC
Please test with 4.3-RELEASE or 4.3-STABLE, if problem persist we'll
look at it, for
now I'll put this pr into suspend.

/Jesper
Comment 2 Jesper Skriver freebsd_committer freebsd_triage 2001-05-28 00:41:14 UTC
State Changed
From-To: open->suspended

Asked submitter to test with released FreeBSD version.
Comment 3 Kris Kennaway freebsd_committer freebsd_triage 2001-08-19 11:08:46 UTC
State Changed
From-To: suspended->closed

Feedback timeout.  4.4-RELEASE will have updated KAME code 
so chances are this is fixed anyway.