From: Keith Owens <kaos@ocs.com.au>
To: Alexander Viro <viro@math.psu.edu>
Cc: Linus Torvalds <torvalds@transmeta.com>, linux-kernel@vger.kernel.org
Subject: Re: [RFC] race in request_module()
Date: Tue, 23 Apr 2002 13:45:33 +1000 [thread overview]
Message-ID: <10796.1019533533@kao2.melbourne.sgi.com> (raw)
In-Reply-To: Your message of "Mon, 22 Apr 2002 23:35:51 -0400." <Pine.GSO.4.21.0204222333120.5686-100000@weyl.math.psu.edu>
On Mon, 22 Apr 2002 23:35:51 -0400 (EDT),
Alexander Viro <viro@math.psu.edu> wrote:
>On Tue, 23 Apr 2002, Keith Owens wrote:
>> 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.
Where is the race?
open /dev/foo
request_module(foo)
load foo, mark !MOD_USED_ONCE.
continue with open, MOD_INC_USE_COUNT(foo), mark MOD_USED_ONCE.
return to use, module is locked down
User space closes /dev/foo
Release foo resources.
MOD_DEC_USE_COUNT(foo)
return to user space
rmmod -a cleans up. Nothing is using foo, it is removed.
next prev parent reply other threads:[~2002-04-23 17:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-23 0:49 [RFC] race in request_module() Alexander Viro
2002-04-23 0:58 ` Matthew Dharm
2002-04-23 1:05 ` Alexander Viro
2002-04-23 2:42 ` Matthew Dharm
2002-04-23 3:01 ` Alexander Viro
2002-04-23 3:30 ` Keith Owens
2002-04-23 3:35 ` Alexander Viro
2002-04-23 3:45 ` Keith Owens [this message]
2002-04-23 18:09 ` Alexander Viro
2002-04-23 22:56 ` Keith Owens
2002-04-29 2:42 ` Rusty Russell
[not found] <mailman.1019523121.12485.linux-kernel2news@redhat.com>
2002-04-23 5:05 ` Pete Zaitcev
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=10796.1019533533@kao2.melbourne.sgi.com \
--to=kaos@ocs.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
--cc=viro@math.psu.edu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox