linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve Dickson <SteveD@redhat.com>
To: Jeff Layton <jlayton@redhat.com>
Cc: linux-nfs@vger.kernel.org
Subject: Re: [PATCH] gssd: don't let spurious signals interrupt the wait after forking
Date: Wed, 20 Nov 2013 16:23:38 -0500	[thread overview]
Message-ID: <528D285A.2010907@RedHat.com> (raw)
In-Reply-To: <1384526265-4494-1-git-send-email-jlayton@redhat.com>



On 15/11/13 09:37, Jeff Layton wrote:
> Because gssd uses dnotify under the hood, it's easily possible that the
> parent process can catch a signal while processing an upcall. If that
> happens, then we'll currently exit the wait for the child task to exit,
> and it'll end up as a zombie.
> 
> Fix this by ensuring that we only wait for the child to actually exit.
> 
> Signed-off-by: Jeff Layton <jlayton@redhat.com>
Committed (tag: nfs-utils-1-2-10-rc1)

steved.
> ---
>  utils/gssd/gssd_proc.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/gssd/gssd_proc.c b/utils/gssd/gssd_proc.c
> index b48d163..447aec1 100644
> --- a/utils/gssd/gssd_proc.c
> +++ b/utils/gssd/gssd_proc.c
> @@ -1040,7 +1040,10 @@ process_krb5_upcall(struct clnt_info *clp, uid_t uid, int fd, char *tgtname,
>  		return;
>  	default:
>  		/* Parent: just wait on child to exit and return */
> -		wait(&err);
> +		do {
> +			pid = wait(&err);
> +		} while(pid == -1 && errno != -ECHILD);
> +
>  		if (WIFSIGNALED(err))
>  			printerr(0, "WARNING: forked child was killed with signal %d\n",
>  					WTERMSIG(err));
> 

      reply	other threads:[~2013-11-20 21:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-15 14:37 [PATCH] gssd: don't let spurious signals interrupt the wait after forking Jeff Layton
2013-11-20 21:23 ` Steve Dickson [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=528D285A.2010907@RedHat.com \
    --to=steved@redhat.com \
    --cc=jlayton@redhat.com \
    --cc=linux-nfs@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).