aboutsummaryrefslogtreecommitdiff
path: root/scripts/generate_rust_target.rs
diff options
context:
space:
mode:
authorRuihan Li <[email protected]>2023-05-03 21:39:36 +0800
committerLuiz Augusto von Dentz <[email protected]>2023-05-19 15:37:45 -0700
commita2ac591cb4d83e1f2d4b4adb3c14b2c79764650a (patch)
treea548eb9f91d76aa02aadd7825886300615074b51 /scripts/generate_rust_target.rs
parent2910431ab0e500dfc5df12299bb15eef0f30b43e (diff)
Bluetooth: Fix UAF in hci_conn_hash_flush again
Commit 06149746e720 ("Bluetooth: hci_conn: Add support for linking multiple hcon") reintroduced a previously fixed bug [1] ("KASAN: slab-use-after-free Read in hci_conn_hash_flush"). This bug was originally fixed by commit 5dc7d23e167e ("Bluetooth: hci_conn: Fix possible UAF"). The hci_conn_unlink function was added to avoid invalidating the link traversal caused by successive hci_conn_del operations releasing extra connections. However, currently hci_conn_unlink itself also releases extra connections, resulted in the reintroduced bug. This patch follows a more robust solution for cleaning up all connections, by repeatedly removing the first connection until there are none left. This approach does not rely on the inner workings of hci_conn_del and ensures proper cleanup of all connections. Meanwhile, we need to make sure that hci_conn_del never fails. Indeed it doesn't, as it now always returns zero. To make this a bit clearer, this patch also changes its return type to void. Reported-by: [email protected] Closes: https://lore.kernel.org/linux-bluetooth/[email protected]/ Fixes: 06149746e720 ("Bluetooth: hci_conn: Add support for linking multiple hcon") Signed-off-by: Ruihan Li <[email protected]> Co-developed-by: Luiz Augusto von Dentz <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
Diffstat (limited to 'scripts/generate_rust_target.rs')
0 files changed, 0 insertions, 0 deletions