Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1260672
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Oleg Nesterov <oleg@redhat.com> |
| Newsgroups | linux.kernel |
| Subject | Re: WARNING in task_participate_group_stop |
| Date | Mon, 02 Nov 2015 15:20:03 +0100 |
| Message-ID | <qqo7N-6lo-13@gated-at.bofh.it> (permalink) |
| References | <qqnln-5Pq-17@gated-at.bofh.it> |
| X-Original-To | Dmitry Vyukov <dvyukov@google.com> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.18 (2008-05-17) |
| X-Scanned-By | MIMEDefang 2.68 on 10.5.11.27 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 86 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Roland McGrath <roland@hack.frob.com>, Andrew Morton <akpm@linux-foundation.org>, amanieu@gmail.com, pmoore@redhat.com, Ingo Molnar <mingo@kernel.org>, vdavydov@parallels.com, qiaowei.ren@intel.com, dave@stgolabs.net, palmer@dabbelt.com, LKML <linux-kernel@vger.kernel.org>, syzkaller <syzkaller@googlegroups.com>, Kostya Serebryany <kcc@google.com>, Alexander Potapenko <glider@google.com>, Sasha Levin <sasha.levin@oracle.com> |
| X-Original-Date | Mon, 2 Nov 2015 16:13:33 +0100 |
| X-Original-Message-ID | <20151102151333.GA17152@redhat.com> |
| X-Original-References | <CACT4Y+bbV2AM-v=T-pikxZX04T=b5Qzc7a2PY4HoakLcKr8RJw@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1260672 |
Show key headers only | View raw
Hi Dmitry,
On 11/02, Dmitry Vyukov wrote:
>
> WARNING: CPU: 1 PID: 1 at kernel/signal.c:334
> task_participate_group_stop+0x157/0x1d0()
> Modules linked in:
> CPU: 1 PID: 1 Comm: init Not tainted 4.3.0 #48
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
> ffffffff82e40280 ffff88003eb0fae0 ffffffff819efe55 0000000000000000
> ffff88003eb0fb20 ffffffff810ec871 ffffffff8110f4d7 ffff88003eb00000
> ffff88003eb20000 0000000000000000 ffff88003eb0fbf8 ffff88003eb20000
> Call Trace:
> [<ffffffff810eca35>] warn_slowpath_null+0x15/0x20 kernel/panic.c:480
> [<ffffffff8110f4d7>] task_participate_group_stop+0x157/0x1d0
> kernel/signal.c:334
> [<ffffffff81113587>] do_signal_stop+0x1e7/0x6e0 kernel/signal.c:2060
> [<ffffffff81116ab7>] get_signal+0x387/0x11b0 kernel/signal.c:2316
> [<ffffffff8100cf0d>] do_signal+0x8d/0x19e0 arch/x86/kernel/signal.c:707
> [<ffffffff81005d8d>] prepare_exit_to_usermode+0x11d/0x170
> arch/x86/entry/common.c:251
> [<ffffffff81005e83>] syscall_return_slowpath+0xa3/0x2b0
> arch/x86/entry/common.c:317
> [<ffffffff82d4f6a7>] int_ret_from_sys_call+0x25/0x8f
> arch/x86/entry/entry_64.S:281
> ---[ end trace f6697fd630b7c361 ]---
>
>
> The reproducer is (needs to be run as root):
>
> // autogenerated by syzkaller (http://github.com/google/syzkaller)
> #include <sys/ptrace.h>
> #include <unistd.h>
>
> int main()
> {
> int pid = 1;
> ptrace(PTRACE_ATTACH, pid, 0, 0);
> ptrace(PTRACE_SETOPTIONS, pid, 0, PTRACE_O_EXITKILL);
> sleep(1);
> return 0;
> }
Thanks.
Can't reproduce, but at first glance the problem looks clear...
> Yes, it is weird and it kills init right afterwards.
Could you confirm that this WARN_ON() happens _after_ the reproducer exits?
> But I wasn't able
> to figure out what's the root cause (why task does not have
> JOBCTL_STOP_PENDING) and maybe the same WARNING can be triggered
> without root and/or with other than init process. So still posting it
> here.
Yes I think you are right. SIGSTOP can race with SIGKILL which (unlike SIGCONT)
doesn't clear JOBCTL_STOP_DEQUEUED/PENDING/etc.
This is mostly fine, the task won't block in TASK_STOPPED if SIGKILL is pending,
but still is not right and leads to the warning above: JOBCTL_STOP_PENDING was not
set because do_signal_stop()->task_set_jobctl_pending() checks fatal_signal_pending().
Probably the patch below should fix the problem, but I'd like to think more before
I send the fix.
Oleg.
--- x/kernel/signal.c
+++ x/kernel/signal.c
@@ -2002,7 +2002,7 @@ static bool do_signal_stop(int signr)
WARN_ON_ONCE(signr & ~JOBCTL_STOP_SIGMASK);
if (!likely(current->jobctl & JOBCTL_STOP_DEQUEUED) ||
- unlikely(signal_group_exit(sig)))
+ unlikely(fatal_signal_pending(current)))
return false;
/*
* There is no group stop already in progress. We must
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
WARNING in task_participate_group_stop Dmitry Vyukov <dvyukov@google.com> - 2015-11-02 14:30 +0100
Re: WARNING in task_participate_group_stop Oleg Nesterov <oleg@redhat.com> - 2015-11-02 15:20 +0100
Re: WARNING in task_participate_group_stop Dmitry Vyukov <dvyukov@google.com> - 2015-11-02 15:30 +0100
Re: WARNING in task_participate_group_stop Oleg Nesterov <oleg@redhat.com> - 2015-11-02 15:40 +0100
Re: WARNING in task_participate_group_stop Oleg Nesterov <oleg@redhat.com> - 2015-11-02 16:50 +0100
Re: WARNING in task_participate_group_stop Oleg Nesterov <oleg@redhat.com> - 2015-11-02 18:20 +0100
[PATCH 1/1] signal: kill the obsolete SIGNAL_UNKILLABLE check in complete_signal() Oleg Nesterov <oleg@redhat.com> - 2015-11-04 19:30 +0100
Re: [PATCH 1/1] signal: kill the obsolete SIGNAL_UNKILLABLE check in complete_signal() Andrew Morton <akpm@linux-foundation.org> - 2015-11-05 02:30 +0100
Re: [PATCH 1/1] signal: kill the obsolete SIGNAL_UNKILLABLE check in complete_signal() Oleg Nesterov <oleg@redhat.com> - 2015-11-05 16:20 +0100
Re: [PATCH 1/1] signal: kill the obsolete SIGNAL_UNKILLABLE check in complete_signal() Oleg Nesterov <oleg@redhat.com> - 2015-11-05 18:10 +0100
[PATCH 0/1] (Was: WARNING in task_participate_group_stop) Oleg Nesterov <oleg@redhat.com> - 2015-11-04 19:30 +0100
csiph-web