kernel panic when initializing dummynet

Nicolas Thery nthery at gmail.com
Mon Oct 22 12:53:59 PDT 2007


The default VKERNEL cfg on HEAD crashes at boot-time while
initializing dummynet (NULL ptr dereference).

The call sequence is:

dummynet_modevent() -> ip_dn_init() -> lwkt_domsg() -> lwkt_beginmsg().

port->mp_waitport is dereferenced in the latter function but is
NULLthus causing a crash.  port points to netisr_cpu[0].td_msgport.

The problem is that dummynet is initialized at priority SI_SUB_PSEUDO
but netisr is initialized at priority SI_SUB_PROTO_BEGIN and
SI_SUB_PSEUDO < SI_SUB_PROTO_BEGIN.  netisr_cpu is therefore not yet
initalized when dummynet runs.

I changed dummynet priority (I'm not sure what priority should be
used).  This fixes the problem.

===================================================================
RCS file: /home/dcvs/src/sys/net/dummynet/ip_dummynet.c,v
retrieving revision 1.26
diff -u -p -r1.26 ip_dummynet.c
--- sys/net/dummynet/ip_dummynet.c      20 Oct 2007 09:08:28 -0000      1.26
+++ sys/net/dummynet/ip_dummynet.c      22 Oct 2007 14:00:04 -0000
@@ -2003,6 +2003,6 @@ static moduledata_t dummynet_mod = {
        dummynet_modevent,
        NULL
 };
-DECLARE_MODULE(dummynet, dummynet_mod, SI_SUB_PSEUDO, SI_ORDER_ANY);
+DECLARE_MODULE(dummynet, dummynet_mod, SI_SUB_PROTO_IF, SI_ORDER_ANY);
 MODULE_DEPEND(dummynet, ipfw, 1, 1, 1);
 MODULE_VERSION(dummynet, 1);





More information about the Bugs mailing list