]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 14 Mar 2023 15:46:31 +0000 (16:46 +0100)
commitd72b2734b1c3bfa51a289bd14b133b9e9bc0c9ec
treeccfdf6535148c72280552ca92ce876de7db48503
parent76fe98412fbeebdf068d4985ca65048cfc34fe6c
Bluetooth: L2CAP: Fix potential user-after-free

BugLink: https://bugs.launchpad.net/bugs/2011425
[ Upstream commit df5703348813235874d851934e957c3723d71644 ]

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: a6a5568c03c4 ("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>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c