[CHECKER] 4 warnings in kernel/module.c

Junfeng Yang (yjf@stanford.edu)
Fri, 23 Mar 2001 02:41:40 -0800 (PST)


Hi, we modified the block checker and run it again on linux 2.4.1. (The
block checker flags an error when blocking functions are called with
either interrupts disabled or a spin lock held. )

It gave us 4 warnings in kernel/module.c. Because we are unaware of the
contexts where these functions are called, we are not sure if these 4
warnings are real errors or false positives. Please help us to verify them
or show that they are false positives.

As usual, please CC us at mc@cs.stanford.edu. Any help will be
appreciated.

---------------------------------------------------------

[UNKNOWN] get_mod_name->__get_free_page(GFP_KERNEL). This is in the
KERNEL. Definitely need to verify

/u2/acc/oses/linux/2.4.1/kernel/module.c:290:sys_create_module:
ERROR:BLOCK:289:290:calling blocking fn 'get_mod_name' w/ spin lock held
[type=GLOBAL]:289

Start --->
lock_kernel();

Error --->
if ((namelen = get_mod_name(name_user, &name)) < 0) {
error = namelen;
---------------------------------------------------------

[UNKNOWN] get_mod_name->__get_free_page(GFP_KERNEL) This is in the KERNEL.
Definitely need to verify

/u2/acc/oses/linux/2.4.1/kernel/module.c:599:sys_delete_module:
ERROR:BLOCK:597:599:calling blocking fn 'get_mod_name' w/ spin lock held
[type=GLOBAL]:597

Start --->
lock_kernel();
if (name_user) {
Error --->
if ((error = get_mod_name(name_user, &name)) < 0)
goto out;
---------------------------------------------------------

[UNKNOWN] need to verify. in the KERNEL!

/u2/acc/oses/linux/2.4.1/kernel/module.c:376:sys_init_module:
ERROR:BLOCK:342:376:calling blocking fn 'copy_from_user' w/ spin lock held
[type=LOCAL]:342

Start --->
lock_kernel();
Error --->
if ((namelen = get_mod_name(name_user, &name)) < 0) {
error = namelen;
goto err0;
}

... DELETED 26 lines ...

goto err1;
}
strcpy(name_tmp, mod->name);

Error --->
error = copy_from_user(mod, mod_user, mod_user_size);
if (error) {
---------------------------------------------------------

[UNKNOWN] need to verify. in the KERNEL!

/u2/acc/oses/linux/2.4.1/kernel/module.c:888:sys_query_module:
ERROR:BLOCK:881:888:calling blocking fn 'get_mod_name' w/ spin lock held
[type=GLOBAL]:881

Start --->
lock_kernel();
if (name_user == NULL)
mod = &kernel_module;
else {
long namelen;
char *name;

Error --->
if ((namelen = get_mod_name(name_user, &name)) < 0) {
err = namelen;
---------------------------------------------------------

A few questions:

1. Is it OK to call blocking functions in the functions like
/init/main.c:init and init/main.c:start_kernel with a spin lock held? It
seems OK because the system is booting when these functions are called.

2. Can functions like kmem_cache_create, kmem_cache_alloc, alloc_page
block?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/