Bluetooth: Fix use-after-free in hci_remove_ltk/hci_remove_irk
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 30 May 2023 20:48:44 +0000 (13:48 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 14 Jun 2023 09:15:27 +0000 (11:15 +0200)
commita5490d6a742ca4550ad3f0f2f9e3529109f14625
treed4b87d5c53c4d8bc93718407b0c6785ad8b7fc58
parent1e1e2ee0cf7fae4d69583a86111e720ff9637ee7
Bluetooth: Fix use-after-free in hci_remove_ltk/hci_remove_irk

commit c5d2b6fa26b5b8386a9cc902cdece3a46bef2bd2 upstream.

Similar to commit 0f7d9b31ce7a ("netfilter: nf_tables: fix use-after-free
in nft_set_catchall_destroy()"). We can not access k after kfree_rcu()
call.

Cc: stable@vger.kernel.org
Signed-off-by: Min Li <lm0963hack@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/bluetooth/hci_core.c