Re: [PATCH 2/3] netpoll: netconsole

From: Mitchell Blank Jr
Date: Fri Sep 12 2003 - 00:26:22 EST


Mitchell Blank Jr wrote:
> The netconsole problem is only if the net driver calls printk() with
> its spinlock held (but when not called from netconsole). Then printk()
> won't know that it's unsafe to re-enter the network driver.

BTW, this isn't neccesarily a netconsole-only thing. For instance, has
anyone ever audited all of the serial and lp drivers to make sure that
nothing they call can call printk() while holding a lock? This sounds
fairly serious - we could have any number of simple error cases that would
cause a deadlock with the right "console=" setting.

It'd be interesting if we could do something like:
1. For every function that appears as a "struct console -> write()" call,
follow every possible code path and make a list of every lock that they
can try to acquire exclusively.
2. Then scan the entire code base see if we ever call can printk() while
holding that same lock.

I'm cc:'ing the Stanford Checker team... maybe they'd be interested in adding
something like this to their automated tests.

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