Message ID | 20241224020616.10885-1-mazin@getstate.dev |
---|---|
State | New |
Headers | show |
Series | Bluetooth: MGMT: Fix slab-use-after-free Read in mgmt_remove_adv_monitor_sync | expand |
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=920604 ---Test result--- Test Summary: CheckPatch PENDING 0.34 seconds GitLint PENDING 0.30 seconds SubjectPrefix PASS 0.07 seconds BuildKernel PASS 26.18 seconds CheckAllWarning PASS 28.38 seconds CheckSparse PASS 31.68 seconds BuildKernel32 PASS 25.27 seconds TestRunnerSetup PASS 448.46 seconds TestRunner_l2cap-tester PASS 20.71 seconds TestRunner_iso-tester PASS 34.40 seconds TestRunner_bnep-tester PASS 4.84 seconds TestRunner_mgmt-tester FAIL 123.56 seconds TestRunner_rfcomm-tester PASS 7.73 seconds TestRunner_sco-tester PASS 9.46 seconds TestRunner_ioctl-tester PASS 8.26 seconds TestRunner_mesh-tester PASS 6.10 seconds TestRunner_smp-tester PASS 7.07 seconds TestRunner_userchan-tester PASS 5.06 seconds IncrementalBuild PENDING 0.82 seconds Details ############################## Test: CheckPatch - PENDING Desc: Run checkpatch.pl script Output: ############################## Test: GitLint - PENDING Desc: Run gitlint Output: ############################## Test: TestRunner_mgmt-tester - FAIL Desc: Run mgmt-tester with test-runner Output: Total: 490, Passed: 484 (98.8%), Failed: 2, Not Run: 4 Failed Test Cases LL Privacy - Add Device 3 (AL is full) Failed 0.206 seconds LL Privacy - Set Flags 3 (2 Devices to RL) Failed 0.181 seconds ############################## Test: IncrementalBuild - PENDING Desc: Incremental build with the patches in the series Output: --- Regards, Linux Bluetooth
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c index b31192d473d0..799e4a7dfde5 100644 --- a/net/bluetooth/mgmt.c +++ b/net/bluetooth/mgmt.c @@ -5519,10 +5519,16 @@ static void mgmt_remove_adv_monitor_complete(struct hci_dev *hdev, { struct mgmt_rp_remove_adv_monitor rp; struct mgmt_pending_cmd *cmd = data; - struct mgmt_cp_remove_adv_monitor *cp = cmd->param; + struct mgmt_cp_remove_adv_monitor *cp; + + if (status == -ECANCELED || + cmd != pending_find(MGMT_OP_REMOVE_ADV_MONITOR, hdev)) + return; hci_dev_lock(hdev); + cp = cmd->param; + rp.monitor_handle = cp->monitor_handle; if (!status) @@ -5540,6 +5546,10 @@ static void mgmt_remove_adv_monitor_complete(struct hci_dev *hdev, static int mgmt_remove_adv_monitor_sync(struct hci_dev *hdev, void *data) { struct mgmt_pending_cmd *cmd = data; + + if (cmd != pending_find(MGMT_OP_REMOVE_ADV_MONITOR, hdev)) + return -ECANCELED; + struct mgmt_cp_remove_adv_monitor *cp = cmd->param; u16 handle = __le16_to_cpu(cp->monitor_handle);