summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-04-12 01:03:03 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-04-12 01:03:03 -0700
commit2386894043fc3be2c0d2d25edb8c741f18c592ec (patch)
treee86a2a9c5580679ece847bce71cb029836365cce /include/linux
parent94ce318546808714dbbdc8a00a1332df9ab79fad (diff)
[PATCH] do_fork() error path memory leak
From: <john.l.byrne@hp.com> In do_fork(), if an error occurs after the mm_struct for the child has been allocated, it is never freed. The exit_mm() meant to free it increments the mm_count and this count is never decremented. (For a running process that is exitting, schedule() takes care this; however, the child process being cleaned up is not running.) In the CLONE_VM case, the parent's mm_struct will get an extra mm_count and so it will never be freed. This patch should fix both the CLONE_VM and the not CLONE_VM case; the test of p->active_mm prevents a panic in the case that a kernel-thread is being cloned.
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions