[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87im4huuok.mognet@arm.com>
Date: Tue, 20 Apr 2021 11:17:15 +0100
From: Valentin Schneider <valentin.schneider@....com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: syzbot <syzbot+9362b31a2e0cad8b749d@...kaller.appspotmail.com>,
bp@...en8.de, dwmw@...zon.co.uk, hpa@...or.com,
linux-kernel@...r.kernel.org, luto@...nel.org, mingo@...hat.com,
syzkaller-bugs@...glegroups.com, tglx@...utronix.de, x86@...nel.org
Subject: Re: [syzbot] WARNING in kthread_is_per_cpu
On 20/04/21 12:11, Peter Zijlstra wrote:
> On Tue, Apr 20, 2021 at 10:43:43AM +0100, Valentin Schneider wrote:
>> On 20/04/21 10:51, Peter Zijlstra wrote:
>
>> > I think free_kthread_struct() is ok, because a task at that point in its
>> > lifetime cannot be also doing exec().
>> >
>>
>> What if it's one of those kthreads created by directly invoking
>> kernel_thread()? AFAICT right now it's only umh, and that one does execve()
>> so it ends up stripped of PF_KTHREAD. It could however go through an error
>> path, i.e. not call exec, and exit, giving us:
>>
>> put_task_struct(p)
>> `\
>> free_task(p)
>> `\
>> if (tsk->flags & PF_KTHREAD)
>> free_kthread_struct(tsk);
>> `\
>> to_kthread(p)
>
> I'm not following, at the point we hit free_task() it had better be dead
> and p->flags had better be stable. Either it will, or will not, have
> PF_KTHREAD.
Bah, don't mind me, for some reason I was obsessed by that umh thing of
having
(p->flags & PF_KTHREAD) && !p->set_child_tid
but that's not a problem there. Sorry about that.
Powered by blists - more mailing lists