Skip to content

Commit 82c260c

Browse files
committed
Merge tag 'for-net-2025-02-13' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Luiz Augusto von Dentz says: ==================== bluetooth pull request for net: - btintel_pcie: Fix a potential race condition - L2CAP: Fix slab-use-after-free Read in l2cap_send_cmd - L2CAP: Fix corrupted list in hci_chan_del * tag 'for-net-2025-02-13' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth: Bluetooth: L2CAP: Fix corrupted list in hci_chan_del Bluetooth: btintel_pcie: Fix a potential race condition Bluetooth: L2CAP: Fix slab-use-after-free Read in l2cap_send_cmd ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 458bf63 + ab4eedb commit 82c260c

File tree

4 files changed

+92
-100
lines changed

4 files changed

+92
-100
lines changed

drivers/bluetooth/btintel_pcie.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,6 +1320,10 @@ static int btintel_pcie_send_frame(struct hci_dev *hdev,
13201320
if (opcode == 0xfc01)
13211321
btintel_pcie_inject_cmd_complete(hdev, opcode);
13221322
}
1323+
/* Firmware raises alive interrupt on HCI_OP_RESET */
1324+
if (opcode == HCI_OP_RESET)
1325+
data->gp0_received = false;
1326+
13231327
hdev->stat.cmd_tx++;
13241328
break;
13251329
case HCI_ACLDATA_PKT:
@@ -1357,7 +1361,6 @@ static int btintel_pcie_send_frame(struct hci_dev *hdev,
13571361
opcode, btintel_pcie_alivectxt_state2str(old_ctxt),
13581362
btintel_pcie_alivectxt_state2str(data->alive_intr_ctxt));
13591363
if (opcode == HCI_OP_RESET) {
1360-
data->gp0_received = false;
13611364
ret = wait_event_timeout(data->gp0_wait_q,
13621365
data->gp0_received,
13631366
msecs_to_jiffies(BTINTEL_DEFAULT_INTR_TIMEOUT_MS));

include/net/bluetooth/l2cap.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ struct l2cap_conn {
668668
struct l2cap_chan *smp;
669669

670670
struct list_head chan_l;
671-
struct mutex chan_lock;
671+
struct mutex lock;
672672
struct kref ref;
673673
struct list_head users;
674674
};
@@ -970,6 +970,7 @@ void l2cap_chan_del(struct l2cap_chan *chan, int err);
970970
void l2cap_send_conn_req(struct l2cap_chan *chan);
971971

972972
struct l2cap_conn *l2cap_conn_get(struct l2cap_conn *conn);
973+
struct l2cap_conn *l2cap_conn_hold_unless_zero(struct l2cap_conn *conn);
973974
void l2cap_conn_put(struct l2cap_conn *conn);
974975

975976
int l2cap_register_user(struct l2cap_conn *conn, struct l2cap_user *user);

0 commit comments

Comments
 (0)