Message ID | 20241113160949.1325502-1-luiz.dentz@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 29186974d7f022396a85b8fede8a4c5a3c05a7ba |
Headers | show |
Series | [v3] Bluetooth: fix use-after-free in device_for_each_child() | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/SubjectPrefix | success | Gitlint PASS |
tedd_an/BuildKernel | success | BuildKernel PASS |
tedd_an/CheckAllWarning | success | CheckAllWarning PASS |
tedd_an/CheckSparse | success | CheckSparse PASS |
tedd_an/BuildKernel32 | success | BuildKernel32 PASS |
tedd_an/TestRunnerSetup | success | TestRunnerSetup PASS |
tedd_an/TestRunner_l2cap-tester | success | TestRunner PASS |
tedd_an/TestRunner_iso-tester | fail | TestRunner_iso-tester: WARNING: possible circular locking dependency detected |
tedd_an/TestRunner_bnep-tester | success | TestRunner PASS |
tedd_an/TestRunner_mgmt-tester | success | TestRunner PASS |
tedd_an/TestRunner_rfcomm-tester | success | TestRunner PASS |
tedd_an/TestRunner_sco-tester | success | TestRunner PASS |
tedd_an/TestRunner_ioctl-tester | success | TestRunner PASS |
tedd_an/TestRunner_mesh-tester | success | TestRunner PASS |
tedd_an/TestRunner_smp-tester | success | TestRunner PASS |
tedd_an/TestRunner_userchan-tester | success | TestRunner PASS |
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=909346 ---Test result--- Test Summary: CheckPatch PENDING 0.37 seconds GitLint PENDING 0.19 seconds SubjectPrefix PASS 0.12 seconds BuildKernel PASS 25.59 seconds CheckAllWarning PASS 27.37 seconds CheckSparse PASS 34.08 seconds BuildKernel32 PASS 24.67 seconds TestRunnerSetup PASS 449.74 seconds TestRunner_l2cap-tester PASS 25.07 seconds TestRunner_iso-tester FAIL 32.59 seconds TestRunner_bnep-tester PASS 4.83 seconds TestRunner_mgmt-tester PASS 127.95 seconds TestRunner_rfcomm-tester PASS 8.19 seconds TestRunner_sco-tester PASS 12.69 seconds TestRunner_ioctl-tester PASS 8.48 seconds TestRunner_mesh-tester PASS 6.25 seconds TestRunner_smp-tester PASS 7.92 seconds TestRunner_userchan-tester PASS 4.98 seconds IncrementalBuild PENDING 0.80 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: TestRunner_iso-tester - FAIL Desc: Run iso-tester with test-runner Output: WARNING: possible circular locking dependency detected Total: 124, Passed: 119 (96.0%), Failed: 1, Not Run: 4 Failed Test Cases ISO Connect2 Suspend - Success Failed 4.238 seconds ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth
Hello: This patch was applied to bluetooth/bluetooth-next.git (master) by Luiz Augusto von Dentz <luiz.von.dentz@intel.com>: On Wed, 13 Nov 2024 11:09:49 -0500 you wrote: > From: Dmitry Antipov <dmantipov@yandex.ru> > > Syzbot has reported the following KASAN splat: > > BUG: KASAN: slab-use-after-free in device_for_each_child+0x18f/0x1a0 > Read of size 8 at addr ffff88801f605308 by task kbnepd bnep0/4980 > > [...] Here is the summary with links: - [v3] Bluetooth: fix use-after-free in device_for_each_child() https://git.kernel.org/bluetooth/bluetooth-next/c/29186974d7f0 You are awesome, thank you!
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index 367e32fe30eb..4b54dbbf0729 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c @@ -21,16 +21,6 @@ static const struct device_type bt_link = { .release = bt_link_release, }; -/* - * The rfcomm tty device will possibly retain even when conn - * is down, and sysfs doesn't support move zombie device, - * so we should move the device before conn device is destroyed. - */ -static int __match_tty(struct device *dev, void *data) -{ - return !strncmp(dev_name(dev), "rfcomm", 6); -} - void hci_conn_init_sysfs(struct hci_conn *conn) { struct hci_dev *hdev = conn->hdev; @@ -73,10 +63,13 @@ void hci_conn_del_sysfs(struct hci_conn *conn) return; } + /* If there are devices using the connection as parent reset it to NULL + * before unregistering the device. + */ while (1) { struct device *dev; - dev = device_find_child(&conn->dev, NULL, __match_tty); + dev = device_find_any_child(&conn->dev); if (!dev) break; device_move(dev, NULL, DPM_ORDER_DEV_LAST);