OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] Fix some kallsyms_lookup() vs rmmod races
Re: [PATCH] Fix some kallsyms_lookup() vs rmmod races [message #11231 is a reply to message #11225] Thu, 15 March 2007 16:53 Go to previous messageGo to previous message
Paulo Marques is currently offline  Paulo Marques
Messages: 7
Registered: March 2007
Junior Member
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."
 
Read Message
Read Message
Read Message
Previous Topic: Reg. Eth0
Next Topic: + attach_pid-with-struct-pid-parameter.patch added to -mm tree
Goto Forum:
  


Current Time: Sun Jul 20 06:43:32 GMT 2025

Total time taken to generate the page: 0.22145 seconds