mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Hillf Danton <hdanton@sina.com>
Cc: syzbot <syzbot+943d34fa3cf2191e3068@syzkaller.appspotmail.com>,
	linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	Thomas Gleixner <tglx@linutronix.de>, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH] kthread: Unpark only parked kthreads (was Re: [syzbot] [wireguard?] WARNING in kthread_unpark (2))
Date: Fri, 13 Sep 2024 14:31:52 +0200	[thread overview]
Message-ID: <ZuQwuM9_vnj5sBFc@localhost.localdomain> (raw)
In-Reply-To: <20240913121109.289-1-hdanton@sina.com>

Le Fri, Sep 13, 2024 at 08:11:09PM +0800, Hillf Danton a écrit :
> Test Frederic's idea.
> 
> #syz test upstream master

Thanks!

> 
> --- a/kernel/kthread.c
> +++ b/kernel/kthread.c
> @@ -623,6 +623,8 @@ void kthread_unpark(struct task_struct *
>  {
>  	struct kthread *kthread = to_kthread(k);
>  
> +	if (!test_bit(KTHREAD_SHOULD_PARK, &kthread->flags))
> +		return;
>  	/*
>  	 * Newly created kthread was parked when the CPU was offline.
>  	 * The binding was lost and we need to set it again.

But are the following bits deliberate?

> --- l/drivers/input/misc/yealink.c
> +++ y/drivers/input/misc/yealink.c
> @@ -438,7 +438,7 @@ static void urb_irq_callback(struct urb
>  
>  	yealink_do_idle_tasks(yld);
>  
> -	if (!yld->shutdown) {
> +	if (!yld->shutdown && status != -EPROTO) {
>  		ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC);
>  		if (ret && ret != -EPERM)
>  			dev_err(&yld->intf->dev,
> @@ -460,13 +460,13 @@ static void urb_ctl_callback(struct urb
>  	case CMD_KEYPRESS:
>  	case CMD_SCANCODE:
>  		/* ask for a response */
> -		if (!yld->shutdown)
> +		if (!yld->shutdown && status != -EPROTO)
>  			ret = usb_submit_urb(yld->urb_irq, GFP_ATOMIC);
>  		break;
>  	default:
>  		/* send new command */
>  		yealink_do_idle_tasks(yld);
> -		if (!yld->shutdown)
> +		if (!yld->shutdown && status != -EPROTO)
>  			ret = usb_submit_urb(yld->urb_ctl, GFP_ATOMIC);
>  		break;
>  	}
> --
> 

  reply	other threads:[~2024-09-13 12:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11 21:47 [syzbot] [wireguard?] WARNING in kthread_unpark (2) syzbot
2024-07-29 15:48 ` syzbot
2024-07-30 10:22   ` Hillf Danton
2024-07-30 11:00     ` syzbot
2024-07-30 11:30   ` Hillf Danton
2024-07-31 11:05   ` Hillf Danton
2024-07-31 11:29     ` syzbot
2024-09-11 12:04       ` [PATCH] kthread: Unpark only parked kthreads (was Re: [syzbot] [wireguard?] WARNING in kthread_unpark (2)) Frederic Weisbecker
2024-09-12 11:30         ` Hillf Danton
2024-09-12 14:26           ` [syzbot] [wireguard?] WARNING in kthread_unpark (2) syzbot
2024-09-13 12:11         ` [PATCH] kthread: Unpark only parked kthreads (was Re: [syzbot] [wireguard?] WARNING in kthread_unpark (2)) Hillf Danton
2024-09-13 12:31           ` Frederic Weisbecker [this message]
2024-09-13 12:48             ` Hillf Danton
2024-09-13 12:38           ` [syzbot] [wireguard?] WARNING in kthread_unpark (2) syzbot
2024-09-13 13:16             ` Frederic Weisbecker
2024-08-12  4:53 ` syzbot

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=ZuQwuM9_vnj5sBFc@localhost.localdomain \
    --to=frederic@kernel.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=syzbot+943d34fa3cf2191e3068@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®