]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
Bluetooth: hci_conn: Fix UAF Write in __hci_acl_create_connection_sync
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 9 Feb 2024 14:08:06 +0000 (09:08 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Sep 2024 09:11:33 +0000 (11:11 +0200)
commit98f66ea456d5cec528689282d154e2989618e876
tree2d0321170cdf1ccd54537323f96c2c4d46fe8a9e
parente78bd85af2978e003b618e1fc36b4d8f8903b4cc
Bluetooth: hci_conn: Fix UAF Write in __hci_acl_create_connection_sync

[ Upstream commit 5f641f03abccddd1a37233ff1b8e774b9ff1f4e8 ]

This fixes the UAF on __hci_acl_create_connection_sync caused by
connection abortion, it uses the same logic as to LE_LINK which uses
hci_cmd_sync_cancel to prevent the callback to run if the connection is
abort prematurely.

Reported-by: syzbot+3f0a39be7a2035700868@syzkaller.appspotmail.com
Fixes: 45340097ce6e ("Bluetooth: hci_conn: Only do ACL connections sequentially")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Stable-dep-of: 227a0cdf4a02 ("Bluetooth: MGMT: Fix not generating command complete for MGMT_OP_DISCONNECT")
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/bluetooth/hci_sync.h
net/bluetooth/hci_conn.c
net/bluetooth/hci_sync.c