Bluetooth: L2CAP: Fix invalid access if ECRED Reconfigure fails
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 19 May 2021 20:41:50 +0000 (13:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 19 Jul 2021 07:44:54 +0000 (09:44 +0200)
commit79a313086426841359d47413274a2140ae6cfd57
tree6fe054a958c6bcfa5970875232f9ec1ace025518
parentc4a9967e4d0961f53cf12b7c666fed6a7c2df783
Bluetooth: L2CAP: Fix invalid access if ECRED Reconfigure fails

[ Upstream commit 1fa20d7d4aad02206e84b74915819fbe9f81dab3 ]

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

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
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