Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Apr 1997 18:24:26 +1000 (EST)
From:      Darren Reed <avalon@coombs.anu.edu.au>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        avalon@coombs.anu.edu.au, msmith@atrad.adelaide.edu.au, bde@zeta.org.au, hackers@FreeBSD.org
Subject:   Re: Unloading LKMs (was Re: A Desparate Plea for Help...)
Message-ID:  <199704300825.BAA15503@hub.freebsd.org>
In-Reply-To: <199704300805.SAA11920@godzilla.zeta.org.au> from "Bruce Evans" at Apr 30, 97 06:05:48 pm

next in thread | previous in thread | raw e-mail | index | archive | help
In some mail from Bruce Evans, sie said:
> 
> >> > Er, AFAIK unloading LKM drivers is broken in all cases.  It certainly
>                              ^^^^^^^
> 
> >Hmmm, IP Filter unloads and reloads easily enough.
> 
> It's not a driver.

Actually, it is a character device module:
MOD_DECL(if_ipl);

static struct lkm_dev _module = {
        LM_DEV,
        LKM_VERSION,
        IPL_VERSION,
        CDEV_MAJOR,
        LM_DT_CHAR,
        (void *)&ipl_cdevsw
};


> >However, give some thought to a process which is in a kernel sleep state,
> >inside the LKM and theLKM is removed, leaving the process still sleeping
> >on a now invalid address.
> 
> Drivers are supposed to do nothing return nonzero in their unload function
> if they are busy.

I found that attempting to keep track of whether you are busy or not made
things worse.  Whether it be via signal 9 or whatever, it is somehow possible
for things to not get cleaned up properly and you end up thinking you are
busy when you aren't.  Maybe this has changed or someone wants to look
into it further ?

Darren



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704300825.BAA15503>