All of lore.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH RESEND] pidns: fix free_pid() to handle the first fork failure
Date: Mon, 16 Sep 2013 04:35:08 -0700	[thread overview]
Message-ID: <87eh8pknir.fsf@xmission.com> (raw)
In-Reply-To: <20130915172648.GA16131@redhat.com> (Oleg Nesterov's message of "Sun, 15 Sep 2013 19:26:48 +0200")

Oleg Nesterov <oleg@redhat.com> writes:

> "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().

Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
> ---

I am not really setup to do deal with bug fixes, inbetween releases but
if Andrew doesn't grab this I will toss this in my tree for 3.13.

Eric

>  kernel/pid.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/pid.c b/kernel/pid.c
> index 66505c1..606a212 100644
> --- a/kernel/pid.c
> +++ b/kernel/pid.c
> @@ -272,6 +272,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;

      reply	other threads:[~2013-09-16 11:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-15 17:26 [PATCH RESEND] pidns: fix free_pid() to handle the first fork failure Oleg Nesterov
2013-09-16 11:35 ` Eric W. Biederman [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87eh8pknir.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=serge@hallyn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.