CVE-2026-139379: Bluetooth: hci_core: Keep RCU protection through LTK filtering
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hcicore: Keep RCU protection through LTK filtering
The LTK selected by hcifindltk() must remain allocated while its value is checked against the blocked-key list. The finder releases RCU before passing k->val to hciisblockedkey(). The helper's own RCU section protects the blocked-key list, but the selected LTK may already have been reclaimed before that section starts.
An LE ATT socket security request can reach smpltkencrypt() without holding hdev->lock. With a matching stored LTK and an LTK-type blocked-key entry present, a concurrent MGMTOPLOADLONGTERMKEYS can remove the selected LTK in the following order:
Socket security Management / RCU reclamation hcifindltk() rcureadlock() select k rcureadunlock() loadlongtermkeys() hcidevlock(hdev) hcismpltksclear(hdev) listdelrcu(&k->list) kfreercu(k, rcu) grace period ends; k is freed hciisblockedkey(..., k->val) memcmp(b->val, val, ...)
The final comparison reads freed LTK bytes. Entering a new RCU section in hciisblockedkey() cannot protect a pointer obtained before the completed grace period.
Keep the finder's RCU read-side section active through the blocked-key comparison and the warning that reads k->bdaddr. Release it before returning on either matched-key path. This delays reclamation until the finder has finished using the selected record, following the existing IRK lookup pattern.
KFENCE report as below:
================================================================== BUG: KFENCE: use-after-free read in hciisblockedkey+0xdf/0x240
Use-after-free read at 0x00000000b9ee38e4 (in kfence-#249): hciisblockedkey+0xdf/0x240 blockedkeywrapper+0xc5/0x140 [pmbdltkprobe] hcifindltk+0x1aa/0x3e0 smpltkencrypt.isra.0+0xad/0x340 smpconnsecurity+0x3b8/0x8c0 l2capsocksetsockopt+0x1c4b/0x2270 dosocksetsockopt+0x1fb/0x430 syssetsockopt+0x106/0x180 x64syssetsockopt+0xc2/0x160 dosyscall64+0x115/0x6a0 entrySYSCALL64afterhwframe+0x77/0x7f
kfence-#249: 0x00000000121f2ad9-0x000000005b5bfb3d, size=72, cache=kmalloc-96
allocated by task 495 on cpu 0 at 36.722380s (2.603973s ago): hciaddltk+0x1f5/0x3a0 loadlongtermkeys+0x6d0/0x860 hcisocksendmsg+0x128b/0x22e0 syssendto+0x425/0x470 x64syssendto+0xe5/0x1c0 dosyscall64+0x115/0x6a0 entrySYSCALL64afterhwframe+0x77/0x7f
freed by task 533 on cpu 0 at 36.993097s (2.339769s ago): rcufreesheafprepare+0x261/0x2a0 rcufreesheaf+0x1f/0xe0 rcucore+0x661/0x1d10 handlesoftirqs+0x201/0x930 irqexitrcu+0x110/0x1e0 irqexitrcu+0xe/0x20 sysvecapictimerinterrupt+0x6c/0x80 asmsysvecapictimerinterrupt+0x1a/0x20 srsoaliasreturnthunk+0x0/0xfbef5 asanmemcpy+0x23/0x60 createmonitorctrlevent+0x1a2/0x460 mgmtcmdcomplete+0x2da/0x580 loadlongtermkeys+0x741/0x860 hcisocksendmsg+0x128b/0x22e0 syssendto+0x425/0x470 x64syssendto+0xe5/0x1c0 dosyscall64+0x115/0x6a0 entrySYSCALL64afterhwframe+0x77/0x7f
CPU: 1 UID: 0 PID: 495 Comm: python3 Tainted: G O 7.2.0-rc6-pmb-bt-functional-v1+ #1 PREEMPT(lazy) Tainted: [O]=OOTMODULE Hardware name: QEMU Ubuntu 24.04 PC v2 (i440FX + PIIX, archcaps fix, 1996), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 ==================================================================
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Keep the finder’s RCU read-side section active through the blocked-key comparison in hci_is_blocked_key(), and release it before returning on either matched-key path.