[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CABBYNZLEjEtwbr+5W4nt=7HhNLBG9_J9xj_rJC=cbA-1pBgRHQ@mail.gmail.com>
Date: Fri, 18 Nov 2022 12:01:29 -0800
From: Luiz Augusto von Dentz <luiz.dentz@...il.com>
To: Hillf Danton <hdanton@...a.com>
Cc: Thomas Gleixner <tglx@...utronix.de>,
syzbot <syzbot+6fb78d577e89e69602f9@...kaller.appspotmail.com>,
linux-kernel@...r.kernel.org, pbonzini@...hat.com,
syzkaller-bugs@...glegroups.com,
Steven Rostedt <rosted@...dmis.org>,
Marcel Holtmann <marcel@...tmann.org>,
Tetsuo Handa <penguin-kernel@...ove.sakura.ne.jp>
Subject: Re: [syzbot] WARNING in call_timer_fn
Hi Hillf,
On Thu, Nov 17, 2022 at 5:28 PM Hillf Danton <hdanton@...a.com> wrote:
>
> On Thu, Nov 17, 2022 at 1:04 PM Luiz Augusto von Dentz <luiz.dentz@...il.com> wrote:
> > >
> > > I thought we would have something similar to shutdown_timer (e.g.
> > > shutdown_delayed_work) so we can safely free its object/struct, at
> > > least that was the impression I got when discussing with Steven.
>
> Because of the cough in Bluetooth's throat does not mean it makes sense
> to ask workqueue to take a flu jab. Why not cure it directly locally,
> given the cases of workqueue under the drivers dir. And timer?
Like Thomas said we can only resolve this partially with the likes of
cancel_workqueue(_sync), though we can use HCI_UNREGISTER to stop
rescheduling cmd_timer, so imo having something similar to
shutdown_timer makes things simpler for subsystems/drivers, anyway I'm
fine fixing it directly since it is probably going to be simpler to
backport, perhaps something like the following is all we need:
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 0540555b3704..977684f5fb57 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -4090,6 +4090,7 @@ static void hci_cmd_work(struct work_struct *work)
rcu_read_lock();
if (test_bit(HCI_RESET, &hdev->flags) ||
+ test_bit(HCI_UNREGISTER, &hdev->flags) ||
hci_dev_test_flag(hdev, HCI_CMD_DRAIN_WORKQUEUE))
cancel_delayed_work(&hdev->cmd_timer);
else
--
Luiz Augusto von Dentz
Powered by blists - more mailing lists