From: Oleg Nesterov <onestero@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Roland McGrath <roland@redhat.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: SIGTRAP vs. sys_exit_group race
Date: Thu, 16 Oct 2008 18:57:27 +0200 [thread overview]
Message-ID: <20081016165727.GA6442@redhat.com> (raw)
In-Reply-To: <48EA1BE9.1030707@siemens.com>
Roland, what do you think?
On 10/06, Jan Kiszka wrote:
>
> --- a/kernel/signal.c
> +++ b/kernel/signal.c
> @@ -1528,10 +1528,11 @@ static void ptrace_stop(int exit_code, i
> spin_unlock_irq(¤t->sighand->siglock);
> arch_ptrace_stop(exit_code, info);
> spin_lock_irq(¤t->sighand->siglock);
> - if (sigkill_pending(current))
> - return;
> }
>
> + if (sigkill_pending(current))
> + return;
> +
Personally, I think this change is good anyway. The tracee shouldn't
sleep in TASK_TRACED with the pending SIGKILL.
And the current code is confusing, imho. Why do we check sigkill_pending()
under arch_ptrace_stop_needed() ? Yes, it unlocks ->siglock and can sleep,
so SIGKILL can come in between. But it is quite possible that SIGKILL is
already pending when we enter ptrace_stop().
The only problem I can see this patch adds a user-visible change, even
if this change looks good to me. For example, if we send SIGKILL to
the thread group, the tracee will not send PTRACE_EVENT_EXIT.
I think we need further changes. If the thread group group was killed
by some fatal signal (but not SIGKILL) the tracee will sleep with
SIGNAL_GROUP_EXIT, this is not nice too. But imho the patch makes
sense anyway.
Oleg.
next prev parent reply other threads:[~2008-10-16 16:56 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-06 14:08 SIGTRAP vs. sys_exit_group race Jan Kiszka
2008-10-16 16:57 ` Oleg Nesterov [this message]
2008-12-03 4:47 ` Roland McGrath
2008-12-04 18:24 ` Oleg Nesterov
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=20081016165727.GA6442@redhat.com \
--to=onestero@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=linux-kernel@vger.kernel.org \
--cc=roland@redhat.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.