mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
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: Wed, 24 Apr 2002 08:56:01 +1000	[thread overview]
Message-ID: <16795.1019602561@ocs3.intra.ocs.com.au> (raw)
In-Reply-To: Your message of "Tue, 23 Apr 2002 14:09:21 -0400." <Pine.GSO.4.21.0204231407280.8087-100000@weyl.math.psu.edu>

On Tue, 23 Apr 2002 14:09:21 -0400 (EDT), 
Alexander Viro <viro@math.psu.edu> wrote:
>
>
>On Tue, 23 Apr 2002, Keith Owens wrote:
>
>>   open /dev/foo
>>     request_module(foo)
>>       load foo, mark !MOD_USED_ONCE.
>
>Another process:
>	open /dev/foo
>		MOD_INC_USE_COUNT
>		mark MOD_USED_ONCE
>	close /dev/foo
>		MOD_DEC_USE_COUNT
>rmmod -a
>	kills module
>
>>     continue with open, MOD_INC_USE_COUNT(foo), mark MOD_USED_ONCE.
>			  module not loaded

You need two rmmod -a sweeps with no intervening activity on the module
before the module will be autocleaned.  See MOD_VISITED.  Unless the
first process hangs in the kernel for minutes, it will find the module
still present, use the module and cancel the rmmod -a status.

BTW, I do not disagree that module unloading in general is racy,
especially for ancillary data such as exception tables, unwind data,
timers, kernel threads etc.  Which is why Rusty and I plan to rewrite
module loading and unloading in 2.5.  I just do not see a race in the
area you are looking at.


  reply	other threads:[~2002-04-24  1:13 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-23  0:49 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
2002-04-23 18:09       ` Alexander Viro
2002-04-23 22:56         ` Keith Owens [this message]
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=16795.1019602561@ocs3.intra.ocs.com.au \
    --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

all inboxes | Powered by JetHome®