Bluetooth: Fix potential use-after-free when clear keys
authorMin Li <lm0963hack@gmail.com>
Mon, 7 Aug 2023 11:07:41 +0000 (19:07 +0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 11 Aug 2023 18:56:16 +0000 (11:56 -0700)
commit3673952cf0c6cf81b06c66a0b788abeeb02ff3ae
treef0bd93f3c8a655a474aca78be67fad6a8c877213
parenta1f6c3aef13c9e7f8d459bd464e9e34da1342c0c
Bluetooth: Fix potential use-after-free when clear keys

Similar to commit c5d2b6fa26b5 ("Bluetooth: Fix use-after-free in
hci_remove_ltk/hci_remove_irk"). We can not access k after kfree_rcu()
call.

Fixes: d7d41682efc2 ("Bluetooth: Fix Suspicious RCU usage warnings")
Signed-off-by: Min Li <lm0963hack@gmail.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_core.c