Subject: + pidns-fix-free_pid-to-handle-the-first-fork-failure.patch added to -mm tree To: oleg@xxxxxxxxxx,ebiederm@xxxxxxxxxxxx,serge@xxxxxxxxxx From: akpm@xxxxxxxxxxxxxxxxxxxx Date: Thu, 19 Sep 2013 16:21:15 -0700 The patch titled Subject: pidns: fix free_pid() to handle the first fork failure has been added to the -mm tree. Its filename is pidns-fix-free_pid-to-handle-the-first-fork-failure.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/pidns-fix-free_pid-to-handle-the-first-fork-failure.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/pidns-fix-free_pid-to-handle-the-first-fork-failure.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Oleg Nesterov <oleg@xxxxxxxxxx> Subject: pidns: fix free_pid() to handle the first fork failure "case 0" in free_pid() assumes that disable_pid_allocation() should clear PIDNS_HASH_ADDING before the last pid goes away. However this doesn't happen if the 1st fork() fails to create the child reaper which should call disable_pid_allocation(). Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx> Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Cc: "Serge E. Hallyn" <serge@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- kernel/pid.c | 5 +++++ 1 file changed, 5 insertions(+) diff -puN kernel/pid.c~pidns-fix-free_pid-to-handle-the-first-fork-failure kernel/pid.c --- a/kernel/pid.c~pidns-fix-free_pid-to-handle-the-first-fork-failure +++ a/kernel/pid.c @@ -273,6 +273,11 @@ void free_pid(struct pid *pid) */ wake_up_process(ns->child_reaper); break; + case PIDNS_HASH_ADDING: + /* Handle a fork failure of the first process */ + WARN_ON(ns->child_reaper); + ns->nr_hashed = 0; + /* fall through */ case 0: schedule_work(&ns->proc_work); break; _ Patches currently in -mm which might be from oleg@xxxxxxxxxx are origin.patch anon_inodefs-forbid-open-via-proc.patch autofs4-allow-autofs-to-work-outside-the-initial-pid-namespace.patch autofs4-translate-pids-to-the-right-namespace-for-the-daemon.patch pidns-fix-free_pid-to-handle-the-first-fork-failure.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html