Bluetooth: L2CAP: Fix invalid access on ECRED Connection response
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 19 May 2021 20:41:51 +0000 (13:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:54 +0000 (09:44 +0200)
commitcc49ab24ec3799f5bc91338fdec81f672a0c5deb
treeccb343e4c86bffbd3af41cc3cdb6a0d4944f4333
parent79a313086426841359d47413274a2140ae6cfd57
Bluetooth: L2CAP: Fix invalid access on ECRED Connection response

[ Upstream commit de895b43932cb47e69480540be7eca289af24f23 ]

The use of l2cap_chan_del is not safe under a loop using
list_for_each_entry.

Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/l2cap_core.c