public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [CHECKER] 4 warnings in kernel/module.c
@ 2001-03-23 10:41 Junfeng Yang
  2001-03-23 11:03 ` Alan Cox
  2001-03-23 11:05 ` Keith Owens
  0 siblings, 2 replies; 5+ messages in thread
From: Junfeng Yang @ 2001-03-23 10:41 UTC (permalink / raw)
  To: linux-kernel; +Cc: mc

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?







^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-03-23 19:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-03-23 10:41 [CHECKER] 4 warnings in kernel/module.c Junfeng Yang
2001-03-23 11:03 ` Alan Cox
2001-03-23 19:49   ` Junfeng Yang
2001-03-23 11:05 ` Keith Owens
2001-03-23 19:56   ` Junfeng Yang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox