From: Paulo Marques <pmarques@grupopie.com>
To: Alexey Dobriyan <adobriyan@sw.ru>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org, devel@openvz.org,
mingo@elte.hu, tglx@linutronix.de, viro@zeniv.linux.org.uk,
rusty@rustcorp.com.au
Subject: Re: [PATCH] Fix some kallsyms_lookup() vs rmmod races
Date: Thu, 15 Mar 2007 16:53:59 +0000 [thread overview]
Message-ID: <45F97A27.4030002@grupopie.com> (raw)
In-Reply-To: <20070315161442.GA6812@localhost.sw.ru>
Alexey Dobriyan wrote:
> [cc'ing folks whose proc files are affected]
>
> kallsyms_lookup() can call module_address_lookup() which iterates over
> modules list without module_mutex taken. Comment at the top of
> module_address_lookup() says it's for oops resolution so races are
> irrelevant, but in some cases it's reachable from regular code:
So maybe we should just add a new parameter to "kallsyms_lookup" to
inform it if it is safe to take a mutex or not.
Spreading module_mutex everywhere doesn't seem like the right interface
for several reasons:
- new users of "kallsyms_lookup" might not be aware that they should
take module_mutex if it is safe
- many times we will be taking module_mutex even when we are fetching
a kernel symbol that shouldn't require the mutex at all
- it just creates new dependencies (hint: this patch shouldn't even
compile with current git since module_mutex is not declared in module.h,
not to mention compile when CONFIG_MODULES not set)
IMHO we should not expose module_mutex outside of module.c. That is just
wrong from an encapsulation point of view.
--
Paulo Marques - www.grupopie.com
"667: The neighbor of the beast."
next prev parent reply other threads:[~2007-03-15 16:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-15 16:14 [PATCH] Fix some kallsyms_lookup() vs rmmod races Alexey Dobriyan
2007-03-15 16:53 ` Paulo Marques [this message]
2007-03-15 18:26 ` Alexey Dobriyan
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=45F97A27.4030002@grupopie.com \
--to=pmarques@grupopie.com \
--cc=adobriyan@sw.ru \
--cc=akpm@osdl.org \
--cc=devel@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rusty@rustcorp.com.au \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
/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.