From: Oliver Neukum <oneukum@suse.com>
To: syzbot <syzbot+485cc00ea7cf41dfdbf1@syzkaller.appspotmail.com>,
Thinh.Nguyen@synopsys.com, bberg@redhat.com,
changbin.du@intel.com, christian.brauner@ubuntu.com,
davem@davemloft.net, edumazet@google.com,
gregkh@linuxfoundation.org, johan.hedberg@gmail.com,
kuba@kernel.org, linux-bluetooth@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
luiz.dentz@gmail.com, luiz.von.dentz@intel.com,
marcel@holtmann.org, mathias.nyman@linux.intel.com,
netdev@vger.kernel.org, stern@rowland.harvard.edu,
syzkaller-bugs@googlegroups.com, yajun.deng@linux.dev
Subject: Re: [syzbot] BUG: sleeping function called from invalid context in hci_cmd_sync_cancel
Date: Thu, 9 Dec 2021 11:06:50 +0100 [thread overview]
Message-ID: <3e8cba55-5d34-eab3-0625-687b66bb9449@suse.com> (raw)
In-Reply-To: <00000000000098464c05d2acf3ba@google.com>
On 09.12.21 02:59, syzbot wrote:
> syzbot has bisected this issue to:
>
> commit c97a747efc93f94a4ad6c707972dfbf8d774edf9
> Author: Benjamin Berg <bberg@redhat.com>
> Date: Fri Dec 3 14:59:02 2021 +0000
>
> Bluetooth: btusb: Cancel sync commands for certain URB errors
Hi,
looking at the patch, it sleeps in an interrupt handler (or equivalent)
in two places:
@@ -933,6 +933,8 @@ static void btusb_intr_complete(struct urb *urb)
if (err != -EPERM && err != -ENODEV)
bt_dev_err(hdev, "urb %p failed to resubmit (%d)",
urb, -err);
+ if (err != -EPERM)
+ hci_cmd_sync_cancel(hdev, -err);
@@ -1331,10 +1335,13 @@ static void btusb_tx_complete(struct urb *urb)
if (!test_bit(HCI_RUNNING, &hdev->flags))
goto done;
- if (!urb->status)
+ if (!urb->status) {
hdev->stat.byte_tx += urb->transfer_buffer_length;
- else
+ } else {
+ if (hci_skb_pkt_type(skb) == HCI_COMMAND_PKT)
+ hci_cmd_sync_cancel(hdev, -urb->status);
As __cancel_work_timer can be called from hci_cmd_sync_cancel() this is
just not
an approach you can take. It looks like asynchronously canceling the
scheduled work
would result in a race, so I would for now just revert.
What issue exactly is this trying to fix or improve?
Regards
Oliver
next prev parent reply other threads:[~2021-12-09 10:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-08 20:36 syzbot
2021-12-09 1:59 ` syzbot
2021-12-09 10:06 ` Oliver Neukum [this message]
2021-12-09 12:46 ` Benjamin Berg
2021-12-09 13:21 ` Oliver Neukum
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=3e8cba55-5d34-eab3-0625-687b66bb9449@suse.com \
--to=oneukum@suse.com \
--cc=Thinh.Nguyen@synopsys.com \
--cc=bberg@redhat.com \
--cc=changbin.du@intel.com \
--cc=christian.brauner@ubuntu.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=johan.hedberg@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=luiz.von.dentz@intel.com \
--cc=marcel@holtmann.org \
--cc=mathias.nyman@linux.intel.com \
--cc=netdev@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=syzbot+485cc00ea7cf41dfdbf1@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
--cc=yajun.deng@linux.dev \
/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®