Fix race between rmmod and cat /proc/kallsyms
authorAlexey Dobriyan <adobriyan@sw.ru>
Tue, 8 May 2007 07:28:39 +0000 (00:28 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 8 May 2007 18:15:08 +0000 (11:15 -0700)
commitea07890a680273b25127129fb555aac0d9324bea
treeb0742aa5dd90792dc10be3563c1181582d0f5d9e
parentae84e324709d6320ed8c1fd7b1736fcbaf26df95
Fix race between rmmod and cat /proc/kallsyms

module_get_kallsym() leaks "struct module *" outside of module_mutex which is
no-no, because module can dissapear right after mutex unlock.

Copy all needed information from inside module_mutex into caller-supplied
space.

[bunk@stusta.de: is_exported() can now become static]
Signed-off-by: Alexey Dobriyan <adobriyan@sw.ru>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/module.h
kernel/kallsyms.c
kernel/module.c