Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH bluetooth] Bluetooth: hci_event: Requeue failed name resolutions
@ 2026-11-27 15:46 Dickson Wu via B4 Relay
  2026-11-27 22:45 ` bluez.test.bot
  0 siblings, 1 reply; 2+ messages in thread
From: Dickson Wu via B4 Relay @ 2026-11-27 15:46 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Luiz Augusto von Dentz, Marcel Holtmann, Johan Hedberg

From: Dickson Wu <dickson.wu@certik.com>

When a Remote Name Request fails, hci_check_pending_name() removes the
inquiry entry from the resolve list and changes its state to
NAME_NOT_KNOWN, but does not add it to the unknown list.

If an Extended Inquiry Result later supplies a complete name for the
same address, hci_inquiry_cache_update() treats the NAME_NOT_KNOWN
entry as linked and deletes it again. This corrupts the list in
hci_rx_work.

Add the entry to the unknown list after the failed resolution, so a
later result unlinks it exactly once.

Fixes: c3e7c0d90b14 ("Bluetooth: Set name_state to unknown when entry name is empty")
Cc: stable@vger.kernel.org
Signed-off-by: Dickson Wu <dickson.wu@certik.com>
---
Reproduced under UML with KASAN and a vhci controller, on bluetooth-next
f57f78086ab5 and on mainline 9437ee8b6cf6. The sequence is BR/EDR
discovery, an EIR without a complete name, Confirm Name with
name_known=0, the Remote Name Request failing with page timeout, then a
second EIR for the same address with a complete name. The second
inquiry was started with a raw HCI_Inquiry from uid 65534 with no
capabilities, which hci_sec_filter allows. Stock and with the patch
reverted fault in list_del() from hci_extended_inquiry_result_evt() in
hci_rx_work. With the patch the guest stays up with no warning. The
reproducer is available if it helps.

This was found and the fix prepared with AI coding tools (OpenAI Codex
agents, with review by Claude). I went over the analysis and the patch
before signing off.

diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index a9b6a6ccaa03..c767e8d32217 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2582,6 +2582,8 @@ static void hci_check_pending_name(struct hci_dev *hdev, struct hci_conn *conn,
 	list_del(&e->list);
 
 	e->name_state = name ? NAME_KNOWN : NAME_NOT_KNOWN;
+	if (!name)
+		list_add(&e->list, &discov->unknown);
 	mgmt_remote_name(hdev, bdaddr, ACL_LINK, 0x00, e->data.rssi,
 			 name, name_len);
 


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* RE: Bluetooth: hci_event: Requeue failed name resolutions
  2026-11-27 15:46 [PATCH bluetooth] Bluetooth: hci_event: Requeue failed name resolutions Dickson Wu via B4 Relay
@ 2026-11-27 22:45 ` bluez.test.bot
  0 siblings, 0 replies; 2+ messages in thread
From: bluez.test.bot @ 2026-11-27 22:45 UTC (permalink / raw)
  To: linux-bluetooth, dickson.wu

[-- Attachment #1: Type: text/plain, Size: 1815 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/1224787/

---Test result---

Test Summary:
CheckPatch                    PASS      0.76 seconds
VerifyFixes                   PASS      0.12 seconds
VerifySignedoff               PASS      0.12 seconds
GitLint                       PASS      0.34 seconds
SubjectPrefix                 PASS      0.12 seconds
BuildKernel                   PASS      31.28 seconds
CheckAllWarning               PASS      35.17 seconds
CheckSparse                   WARNING   37.95 seconds
BuildKernel32                 PASS      31.26 seconds
CheckKernelLLVM               PASS      34.83 seconds
TestRunnerSetup               PASS      746.33 seconds
TestRunner_l2cap-tester       PASS      14.71 seconds
TestRunner_iso-tester         PASS      13.22 seconds
TestRunner_bnep-tester        PASS      3.22 seconds
TestRunner_mgmt-tester        PASS      89.56 seconds
TestRunner_rfcomm-tester      PASS      4.52 seconds
TestRunner_sco-tester         PASS      5.63 seconds
TestRunner_ioctl-tester       PASS      4.73 seconds
TestRunner_mesh-tester        PASS      4.54 seconds
TestRunner_smp-tester         PASS      4.39 seconds
TestRunner_userchan-tester    PASS      3.25 seconds
TestRunner_6lowpan-tester     PASS      4.46 seconds
IncrementalBuild              PASS      29.43 seconds

Details
##############################
Test: CheckSparse - WARNING
Desc: Run sparse tool with linux kernel
Output:
net/bluetooth/hci_event.c: note: in included file (through include/net/bluetooth/hci_core.h):


https://github.com/bluez/bluetooth-next/pull/1247

---
Regards,
Linux Bluetooth


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-27 22:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-27 15:46 [PATCH bluetooth] Bluetooth: hci_event: Requeue failed name resolutions Dickson Wu via B4 Relay
2026-11-27 22:45 ` 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