[patch] Race condition #2 in arch/ppc/cpm2_io/fcc_enet.c

Stefan Nickl Stefan.Nickl at kontron.com
Fri Nov 26 18:27:48 EST 2004


The initialisation sequence of the fcc ethernet driver contains race
condition that will crash the machine when a packet is received in the
wrong moment during system boot.

The oops usually shows ip_route_input() as the responsible function, but
that is not where things go wrong.
The problem is that when fec_enet_init() calls init_fcc_startup() during
device setup, fcc_restart() enables the receiver and the device will
start to receive packets while the rest of networking is not yet
prepared for this -> crash.
This situation can easily be created when the system is loaded with a
flood ping during boot, it will almost certainly crash (ping the
broadcast address on a isolated network to be sure the booting device
really gets it's share).

The patch moves the calls to fcc_restart() to fcc_enet_open(), so
packets will only start to come in when the kernel is ready for it.

I'm not 100% about all the implications this could have, but it seems to
work fine.

-- 
Stefan Nickl
Kontron Modular Computers

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fcc_enet-startup_race.patch
Type: text/x-patch
Size: 969 bytes
Desc: not available
Url : http://ozlabs.org/pipermail/linuxppc-embedded/attachments/20041126/07333e50/attachment.bin 


More information about the Linuxppc-embedded mailing list