[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201015124926.GA24156@redhat.com>
Date: Thu, 15 Oct 2020 14:49:26 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: "Eric W. Biederman" <ebiederm@...ssion.com>
Cc: syzbot <syzbot+3485e3773f7da290eecc@...kaller.appspotmail.com>,
axboe@...nel.dk, christian@...uner.io,
linux-kernel@...r.kernel.org, liuzhiqiang26@...wei.com,
syzkaller-bugs@...glegroups.com, Tejun Heo <tj@...nel.org>
Subject: Re: WARNING in get_signal
On 10/06, Oleg Nesterov wrote:
>
> I still do not see a good fix. I am crying ;)
Sorry for delay... Finally I think I have a simple and clean fix.
We can leave ptrace_init_task() alone and fix task_join_group_stop().
I need to test it a bit and write the changelog, do you see any problem
in the patch below?
(TODO: SIGCONT should clear JOBCTL_STOP_SIGMASK, needs another patch)
Oleg.
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -391,16 +391,17 @@ static bool task_participate_group_stop(struct task_struct *task)
void task_join_group_stop(struct task_struct *task)
{
+ struct signal_struct *sig = current->signal;
+ unsigned long mask = current->jobctl & JOBCTL_STOP_SIGMASK;
+
+ if (sig->group_stop_count) {
+ sig->group_stop_count++;
+ mask |= JOBCTL_STOP_CONSUME;
+ } else if (!(sig->flags & SIGNAL_STOP_STOPPED))
+ return;
+
/* Have the new thread join an on-going signal group stop */
- unsigned long jobctl = current->jobctl;
- if (jobctl & JOBCTL_STOP_PENDING) {
- struct signal_struct *sig = current->signal;
- unsigned long signr = jobctl & JOBCTL_STOP_SIGMASK;
- unsigned long gstop = JOBCTL_STOP_PENDING | JOBCTL_STOP_CONSUME;
- if (task_set_jobctl_pending(task, signr | gstop)) {
- sig->group_stop_count++;
- }
- }
+ task_set_jobctl_pending(task, mask | JOBCTL_STOP_PENDING);
}
/*
Powered by blists - more mailing lists