* [PATCH] Bluetooth: MGMT: Free unlisted commands on queue failure
@ 2026-10-28 5:06 Jiale Yao
2026-10-28 11:34 ` bluez.test.bot
0 siblings, 1 reply; 2+ messages in thread
From: Jiale Yao @ 2026-10-28 5:06 UTC (permalink / raw)
To: Marcel Holtmann, Luiz Augusto von Dentz, linux-bluetooth,
linux-kernel
Cc: stable
mgmt_pending_new() allocates a command without adding it to the pending
list. set_phy_configuration() and read_local_ssp_oob_req() use this
helper before queuing synchronous HCI work.
If hci_cmd_sync_queue() fails, the work item does not take ownership of
the command. The error paths call mgmt_pending_remove(), which assumes
the command is linked and calls list_del() on its zeroed list node. This
can cause a NULL pointer dereference instead of releasing the command.
Free the unlisted command directly on queue failure.
Fixes: 302a1f674c00 ("Bluetooth: MGMT: Fix possible UAFs")
Cc: stable@vger.kernel.org
Signed-off-by: Jiale Yao <yaojiale02@163.com>
---
net/bluetooth/mgmt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 3b9c82bd2f02..66f167849942 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -4432,7 +4432,7 @@ static int set_phy_configuration(struct sock *sk, struct hci_dev *hdev,
MGMT_STATUS_FAILED);
if (cmd)
- mgmt_pending_remove(cmd);
+ mgmt_pending_free(cmd);
}
unlock:
@@ -8619,7 +8619,7 @@ static int read_local_ssp_oob_req(struct hci_dev *hdev, struct sock *sk,
read_local_oob_ext_data_complete);
if (err < 0) {
- mgmt_pending_remove(cmd);
+ mgmt_pending_free(cmd);
return err;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: Bluetooth: MGMT: Free unlisted commands on queue failure
2026-10-28 5:06 [PATCH] Bluetooth: MGMT: Free unlisted commands on queue failure Jiale Yao
@ 2026-10-28 11:34 ` bluez.test.bot
0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-10-28 11:34 UTC (permalink / raw)
To: linux-bluetooth, yaojiale02
[-- Attachment #1: Type: text/plain, Size: 1128 bytes --]
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/series/1195135/
---Test result---
Test Summary:
CheckPatch PASS 0.80 seconds
VerifyFixes PASS 0.13 seconds
VerifySignedoff PASS 0.14 seconds
GitLint PASS 0.36 seconds
SubjectPrefix PASS 0.13 seconds
BuildKernel PASS 33.66 seconds
CheckAllWarning PASS 38.89 seconds
CheckSparse PASS 41.80 seconds
BuildKernel32 PASS 33.97 seconds
CheckKernelLLVM PASS 37.75 seconds
TestRunnerSetup PASS 778.04 seconds
TestRunner_mgmt-tester PASS 89.18 seconds
TestRunner_mesh-tester PASS 11.23 seconds
IncrementalBuild PASS 31.85 seconds
https://github.com/bluez/bluetooth-next/pull/1014
---
Regards,
Linux Bluetooth
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-28 11:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-28 5:06 [PATCH] Bluetooth: MGMT: Free unlisted commands on queue failure Jiale Yao
2026-10-28 11:34 ` bluez.test.bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox