tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: NULL deref when creating an IDLE kthread(9)



On 30.10.2011 06:18, Joerg Sonnenberger wrote:
On Sat, Oct 29, 2011 at 11:46:01PM +0200, Jean-Yves Migeon wrote:
When creating an IDLE kthread without having a CPU specified, the
actual code in kthread_create(9) will lead to a NULL deref [1].

IDLE as in idle loop? Why do you want to do that?

No, IDLE as LSIDL, e.g. the thread is not scheduled for execution right after creation. When not specified, a thread begins in LSRUN state (runnable but not yet running on a CPU).

Intent behind was to kthread_join() on an LSIDL thread. An earlier design of mine for xbdback(4) required this, but I did it differently afterwards.

Anyway, the issue still remains. kthread(9) specifies that 'ci' is used to spawn CPU-bound threads. The actual code makes it impossible to spawn threads in LSIDL state without making them CPU-bound. My proposal goes around this, but as it is a critical piece of code I'd prefer to get a good review first, even if it's a 4 line patch.

--
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index