Re: [RFC] race in request_module()

From: Alexander Viro (viro@math.psu.edu)
Date: Mon Apr 22 2002 - 22:35:51 EST


On Tue, 23 Apr 2002, Keith Owens wrote:

> There is no such thing as a failing modprobe. It either works and the
> module is loaded or modprobe does not work and the module is not
> loaded. This excludes the case where a module oops during init, but
> that is not what you are worried about.
>
> When a module is loaded, it is marked !MOD_USED_ONCE. An explicit
> rmmod will get rid of the module but rmmod -a will not. rmmod -a will
> not remove a module unless __MOD_INC_USE_COUNT has been issued on the
> module at least once, or the module is loaded to satisfy unresolved
> symbols from another module.

Which is still racy - open()/close() bringing stuff from the same module
during the window in question and there we go.

IOW, echo </dev/foo will merrily set MOD_USED_ONCE.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Apr 23 2002 - 22:00:34 EST