From: Keith Owens <kaos@ocs.com.au>
To: Kingsley Cheung <kingsley@aurema.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Possible Bug in "sys_init_module"?
Date: Mon, 05 Aug 2002 15:35:29 +1000 [thread overview]
Message-ID: <3340.1028525729@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Mon, 05 Aug 2002 14:57:07 +1000." <Pine.LNX.4.44.0208051241290.11259-100000@kingsley.sw.oz.au>
On Mon, 5 Aug 2002 14:57:07 +1000 (EST),
Kingsley Cheung <kingsley@aurema.com> wrote:
>Please cc me since I'm not on the mailing list.
>
>Assume that one script invokes modprobe which calls "sys_init_module"
>first. The big kernel lock is taken and then plenty of sanity checks
>done. After dependencies are checked and updated, the "init_module"
>function of the module is invoked. Now if this function happens to block,
>the kernel lock is dropped. A call to "sys_init_module" by modprobe in
>the other script to initialise a second module dependent on the first
>could then take the big kernel lock, check the dependencies and find them
>okay, and then have its "init_module" function invoked. And if this
>second module relies on the first module being properly initialised
>before it is loaded, this can break.
This is a trade off between two conflicting requirements. If a module
fails during initialization then we want the module symbols to debug
the module. But those same symbols should not be considered valid when
doing insmod. The query_module() interface does not have the
flexibility to distinguish between the two types of user space query.
In any case the problem is bigger than module symbols. What happens
when a module_init breaks after registering some functions? The
functions are registered and can be called, but the module is stuffed.
insmod symbols are just one instance of the wider problem - if a module
fails during init or exit and does not recover then the kernel is in an
unreliable state. It is broken, you get to keep the pieces.
On my todo list for modutils 2.5 is to invoke init_module() from a
separate task. That task will be killed by the kernel oops (there is
no way for userspace to recover from oops) but the parent insmod will
detect the failure and say
init_module() for foo failed. The kernel is in an unreliable state.
next prev parent reply other threads:[~2002-08-05 5:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-05 4:57 Possible Bug in "sys_init_module"? Kingsley Cheung
2002-08-05 5:35 ` Keith Owens [this message]
2002-08-05 7:25 ` Kingsley Cheung
2002-10-16 4:31 ` [PATCH] Bug in "sys_init_module", kernel/module.c, 2.4.19 Kingsley Cheung
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3340.1028525729@kao2.melbourne.sgi.com \
--to=kaos@ocs.com.au \
--cc=kingsley@aurema.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.