Message ID | 20240216205005.111967-1-luiz.dentz@gmail.com |
---|---|
State | New |
Headers | show |
Series | [v1] Bluetooth: hci_sync: Fix UAF on hci_abort_conn_sync | expand |
Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Fri, 16 Feb 2024 15:50:05 -0500 you wrote: > From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> > > Fixes the following trace where hci_acl_create_conn_sync attempts to > call hci_abort_conn_sync after timeout: > > BUG: KASAN: slab-use-after-free in hci_abort_conn_sync > (net/bluetooth/hci_sync.c:5439) > Read of size 2 at addr ffff88800322c032 by task kworker/u3:2/36 > > [...] Here is the summary with links: - [v1] Bluetooth: hci_sync: Fix UAF on hci_abort_conn_sync https://git.kernel.org/bluetooth/bluetooth-next/c/55a7c10e71ae You are awesome, thank you!
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index b7d8e99e2a30..4a28aef2f01f 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -6670,15 +6670,10 @@ static int hci_acl_create_conn_sync(struct hci_dev *hdev, void *data) else cp.role_switch = 0x00; - err = __hci_cmd_sync_status_sk(hdev, HCI_OP_CREATE_CONN, - sizeof(cp), &cp, - HCI_EV_CONN_COMPLETE, - conn->conn_timeout, NULL); - - if (err == -ETIMEDOUT) - hci_abort_conn_sync(hdev, conn, HCI_ERROR_LOCAL_HOST_TERM); - - return err; + return __hci_cmd_sync_status_sk(hdev, HCI_OP_CREATE_CONN, + sizeof(cp), &cp, + HCI_EV_CONN_COMPLETE, + conn->conn_timeout, NULL); } int hci_connect_acl_sync(struct hci_dev *hdev, struct hci_conn *conn)