]> git.baikalelectronics.ru Git - kernel.git/commit
fork.c: fix NULL pointer dereference when nr_threads == threads-max
authorLi Zefan <lizf@cn.fujitsu.com>
Fri, 6 Feb 2009 08:17:19 +0000 (08:17 +0000)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Feb 2009 16:43:11 +0000 (08:43 -0800)
commitac74ed7fe335d4d47180aa026c490ffaa07294f5
treeba7d1ca513641167f61d8d8bb56b832f63d98bca
parent8b92d990528bb3ba43a67421c5f8478545f06ae9
fork.c: fix NULL pointer dereference when nr_threads == threads-max

I happened to forked lots of processes, and hit NULL pointer dereference.
It is because in copy_process() after checking max_threads, 0 is returned
but not -EAGAIN.

The bug is introduced by "CRED: Detach the credentials from task_struct"
(commit ba089e1403bc86632d5bfdfefa006140bdd7248d).

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: James Morris <jmorris@namei.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/fork.c