From: Hillf Danton <hdanton@sina.com>
To: Frederic Weisbecker <frederic@kernel.org>
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 20:11:09 +0800 [thread overview]
Message-ID: <20240913121109.289-1-hdanton@sina.com> (raw)
In-Reply-To: <ZuGHTBfUlB0qlgn4@localhost.localdomain>
Test Frederic's idea.
#syz test upstream master
--- 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.
--- 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;
}
--
next prev parent reply other threads:[~2024-09-13 12:11 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 ` Hillf Danton [this message]
2024-09-13 12:31 ` [PATCH] kthread: Unpark only parked kthreads (was Re: [syzbot] [wireguard?] WARNING in kthread_unpark (2)) Frederic Weisbecker
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=20240913121109.289-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=frederic@kernel.org \
--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®