From: Coiby Xu <coiby.xu@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: linux-kernel-mentees@lists.linuxfoundation.org,
syzbot+fadfba6a911f6bf71842@syzkaller.appspotmail.com,
Marcel Holtmann <marcel@holtmann.org>,
Johan Hedberg <johan.hedberg@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org (open list:NETWORKING [GENERAL]),
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] Bluetooth: Initialize the TX queue lock when creating struct l2cap_chan in 6LOWPAN
Date: Tue, 4 Aug 2020 17:39:37 +0800 [thread overview]
Message-ID: <20200804093937.772961-1-coiby.xu@gmail.com> (raw)
When L2CAP channel is destroyed by hci_unregister_dev, it will
acquire the spin lock of the (struct l2cap_chan *)->tx_q list to
delete all the buffers. But sometimes when hci_unregister_dev is
being called, this lock may have not bee initialized. Initialize
the TX queue lock when creating struct l2cap_chan in 6LOWPAN to fix
this problem.
Reported-by: syzbot+fadfba6a911f6bf71842@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=fadfba6a911f6bf71842
Signed-off-by: Coiby Xu <coiby.xu@gmail.com>
---
net/bluetooth/6lowpan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c
index bb55d92691b0..713c618a73df 100644
--- a/net/bluetooth/6lowpan.c
+++ b/net/bluetooth/6lowpan.c
@@ -651,6 +651,7 @@ static struct l2cap_chan *chan_create(void)
l2cap_chan_set_defaults(chan);
+ skb_queue_head_init(&chan->tx_q);
chan->chan_type = L2CAP_CHAN_CONN_ORIENTED;
chan->mode = L2CAP_MODE_LE_FLOWCTL;
chan->imtu = 1280;
--
2.27.0
next reply other threads:[~2020-08-04 9:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-04 9:39 Coiby Xu [this message]
2020-08-04 9:42 ` [Linux-kernel-mentees] [PATCH] Bluetooth: Initialize the TX queue lock when creating struct l2cap_chan in 6LOWPAN Greg KH
2020-08-04 10:41 ` Coiby Xu
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=20200804093937.772961-1-coiby.xu@gmail.com \
--to=coiby.xu@gmail.com \
--cc=davem@davemloft.net \
--cc=johan.hedberg@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=netdev@vger.kernel.org \
--cc=syzbot+fadfba6a911f6bf71842@syzkaller.appspotmail.com \
/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;
as well as URLs for NNTP newsgroup(s).