]> git.baikalelectronics.ru Git - kernel.git/commit
Bluetooth: L2CAP: Fix potential user-after-free
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 1 Feb 2023 22:01:11 +0000 (14:01 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:33:01 +0000 (09:33 +0100)
commit6804d6ca0ff642e1206bacd9395e43b793e306b5
tree9d30058fab6e921d39ab3fe84caffa3b9ad766e0
parentfaa38e5c2055b54a0e9dacf6716e862e4bb17679
Bluetooth: L2CAP: Fix potential user-after-free

[ Upstream commit 9a9bb84450f09d680a836ad0d702546022369dc2 ]

This fixes all instances of which requires to allocate a buffer calling
alloc_skb which may release the chan lock and reacquire later which
makes it possible that the chan is disconnected in the meantime.

Fixes: b423603811b8 ("Bluetooth: Lock the L2CAP channel when sending")
Reported-by: Alexander Coffin <alex.coffin@matician.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c