Re: [syzbot] WARNING in kthread_bind_mask

From: Z qiang
Date: Tue Jul 11 2023 - 00:02:08 EST


>On Tue, Jul 11, 2023 at 6:07 AM Sean Christopherson <seanjc@xxxxxxxxxx> wrote:
>
> Trimmed the Cc list to avoid annoying folks with my thread necromancy.
>
> On Sun, Feb 20, 2022, syzbot wrote:
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit: c5d9ae265b10 Merge tag 'for-linus' of git://git.kernel.org..
> > git tree: upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=11daf74a700000
> > kernel config: https://syzkaller.appspot.com/x/.config?x=da674567f7b6043d
> > dashboard link: https://syzkaller.appspot.com/bug?extid=087b7effddeec0697c66
> > compiler: gcc (Debian 10.2.1-6) 10.2.1 20210110, GNU ld (GNU Binutils for Debian) 2.35.2
> >
> > Unfortunately, I don't have any reproducer for this issue yet.
> >
> > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > Reported-by: syzbot+087b7effddeec0697c66@xxxxxxxxxxxxxxxxxxxxxxxxx
> >
> > BTRFS info (device loop3): disk space caching is enabled
> > BTRFS info (device loop3): has skinny extents
> > ------------[ cut here ]------------
>

Cc: Tejun

Full email path here:
https://lore.kernel.org/all/0000000000005ca92705d877448c@xxxxxxxxxx/T/
https://syzkaller.appspot.com/bug?extid=087b7effddeec0697c66


static void __kthread_bind_mask(struct task_struct *p, const struct
cpumask *mask, unsigned int state)
{
unsigned long flags;

if (!wait_task_inactive(p, state)) {
WARN_ON(1); <--------------------------trigger warning
return;
}
....
}

Inconsistent task state trigger WARN_ON().


Thanks
Zqiang



>
> Dropping the "kvm" label as this isn't a KVM bug, but rather something in either
> workqueues or sched that KVM often triggers through its use of alloc_workqueue().
>
> #syz set subsystems: kernel