CVE-2025-38250 Bluetooth: hci_core: Fix use-after-free in vhci_flush()
- Published
- Updated
- Exploit status
- No public exploit known
- CISA SSVC
- No known exploitation · automatable: no · technical impact: total
- Technology
- Linux KernelUbuntuDebian
Description
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: hci_core: Fix use-after-free in vhci_flush()
syzbot reported use-after-free in vhci_flush() without repro. [0]
From the splat, a thread close()d a vhci file descriptor while
its device was being used by iotcl() on another thread.
Once the last fd refcnt is released, vhci_release() calls
hci_unregister_dev(), hci_free_dev(), and kfree() for struct
vhci_data, which is set to hci_dev->dev->driver_data.
The problem is that there is no synchronisation after unlinking
hdev from hci_dev_list in hci_unregister_dev(). There might be
another thread still accessing the hdev which was fetched before
the unlink operation.
We can use SRCU for such synchronisation.
Let's run hci_dev_reset() under SRCU and wait for its completion
in hci_unregister_dev().
Another option would be to restore hci_dev->destruct(), which was
removed in commit 587ae086f6e4 ("Bluetooth: Remove unused
hci-destruct cb"). However, this would not be a good solution, as
we should not run hci_unregister_dev() while there are in-flight
ioctl() requests, which could lead to another data-race KCSAN splat.
Note that other drivers seem to have the same problem, for exmaple,
virtbt_remove().
[0]:
BUG: KASAN: slab-use-after-free in skb_queue_empty_lockless include/linux/skbuff.h:1891 [inline]
BUG: KASAN: slab-use-after-free in skb_queue_purge_reason+0x99/0x360 net/core/skbuff.c:3937
Read of size 8 at addr ffff88807cb8d858 by task syz.1.219/6718
CPU: 1 UID: 0 PID: 6718 Comm: syz.1.219 Not tainted 6.16.0-rc1-syzkaller-00196-g08207f42d3ff #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
Call Trace:
<TASK>
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
print_address_description mm/kasan/report.c:408 [inline]
print_report+0xd2/0x2b0 mm/kasan/report.c:521
kasan_report+0x118/0x150 mm/kasan/report.c:634
skb_queue_empty_lockless include/linux/skbuff.h:1891 [inline]
skb_queue_purge_reason+0x99/0x360 net/core/skbuff.c:3937
skb_queue_purge include/linux/skbuff.h:3368 [inline]
vhci_flush+0x44/0x50 drivers/bluetooth/hci_vhci.c:69
hci_dev_do_reset net/bluetooth/hci_core.c:552 [inline]
hci_dev_reset+0x420/0x5c0 net/bluetooth/hci_core.c:592
sock_do_ioctl+0xd9/0x300 net/socket.c:1190
sock_ioctl+0x576/0x790 net/socket.c:1311
vfs_ioctl fs/ioctl.c:51 [inline]
__do_sys_ioctl fs/ioctl.c:907 [inline]
__se_sys_ioctl+0xf9/0x170 fs/ioctl.c:893
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fcf5b98e929
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fcf5c7b9038 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fcf5bbb6160 RCX: 00007fcf5b98e929
RDX: 0000000000000000 RSI: 00000000400448cb RDI: 0000000000000009
RBP: 00007fcf5ba10b39 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fcf5bbb6160 R15: 00007ffd6353d528
</TASK>
Allocated by task 6535:
kasan_save_stack mm/kasan/common.c:47 [inline]
kasan_save_track+0x3e/0x80 mm/kasan/common.c:68
poison_kmalloc_redzone mm/kasan/common.c:377 [inline]
__kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:394
kasan_kmalloc include/linux/kasan.h:260 [inline]
__kmalloc_cache_noprof+0x230/0x3d0 mm/slub.c:4359
kmalloc_noprof include/linux/slab.h:905 [inline]
kzalloc_noprof include/linux/slab.h:1039 [inline]
vhci_open+0x57/0x360 drivers/bluetooth/hci_vhci.c:635
misc_open+0x2bc/0x330 drivers/char/misc.c:161
chrdev_open+0x4c9/0x5e0 fs/char_dev.c:414
do_dentry_open+0xdf0/0x1970 fs/open.c:964
vfs_open+0x3b/0x340 fs/open.c:1094
do_open fs/namei.c:3887 [inline]
path_openat+0x2ee5/0x3830 fs/name
---truncated---
Upgrade path
13 packages: 9 fixed, 1 partially fixed, 3 with no fix yet.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| cbl-mariner kernel(CBL-Mariner 2.0) | All versions | No fix listed | No fix yet |
| Microsoft cbl2 kernel 5.15.202.1-1 | All versions | No fix listed | No fix yet |
| Siemens SIMATIC S7-1500 TM MFP - GNU/Linux subsystem | All versions | No fix listed | No fix yet |
| azure linux kernel(Azure Linux 3.0) | < 6.6.104.2-1; All versions | 6.6.104.2-1 | Partially fixed |
| debian/linux(Debian 12) | < 6.1.170-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +45 more | 6.1.170-1 | Fixed |
| debian/linux(Debian 13) | < 6.12.37-1 | 6.12.37-1 | Fixed |
| debian/linux(Debian 14) | < 6.12.37-1 | 6.12.37-1 | Fixed |
| Linux kernel | < 5.10.259; < 5.15.209; < 6.1.167; < 6.6.97 +17 more | 0e5c144c557df910ab64d9c25d06399a9a735e65, 1d6123102e9fbedc8d25bf4731da6d513173e49e, 5.10.259, 5.15.209, 6.1.167, 6.6.97, 6.12.36, 6.15.5, 6.16, 90dee0a0ff84fac8accd5be98412b3819f667149, bc0819a25e04cd68ef3568cfa51b63118fea39a7, c56b177efce8b62798e4d96bdb9867106cb7c4a0, ce23b73f0f27e2dbeb81734a79db710f05aa33c6, dd4becd3fd4102696e1c15e6d260a1712a2d8685 | Fixed |
| ubuntu/linux(Ubuntu 22.04) | < 5.15.0-186.196 | 5.15.0-186.196 | Fixed |
| ubuntu/linux(Ubuntu 24.04) | < 6.8.0-100.100 | 6.8.0-100.100 | Fixed |
| ubuntu/linux-kvm(Ubuntu 22.04) | < 5.15.0-1104.109 | 5.15.0-1104.109 | Fixed |
| ubuntu/linux-raspi(Ubuntu 22.04) | < 5.15.0-1106.109 | 5.15.0-1106.109 | Fixed |
| ubuntu/linux-raspi(Ubuntu 24.04) | < 6.8.0-1047.51 | 6.8.0-1047.51 | Fixed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| azure linux kernel(Azure Linux:3.0) | All versions | No fix listed |
| azure linux kernel(Azure Linux:3.0) | < 6.6.104.2-1 | 6.6.104.2-1 |
| cbl-mariner kernel(CBL-Mariner:2.0) | All versions | No fix listed |
| Microsoft cbl2 kernel 5.15.202.1-1 | All versions | No fix listed |
| debian/linux(Debian:12) | < 6.1.170-1 | 6.1.170-1 |
| debian/linux(Debian:12) | = 6.1.106-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.112-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.115-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.119-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.123-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.124-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.128-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.129-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.133-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.135-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.137-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.139-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.140-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.147-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.148-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.153-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.158-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.159-1 | No fix listed |
Show 57 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/linux(Debian:12) | = 6.1.162-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.164-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.27-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.37-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.52-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.64-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.66-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.67-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.82-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.85-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.98-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.99-1 | No fix listed |
| debian/linux(Debian:13) | < 6.12.37-1 | 6.12.37-1 |
| debian/linux(Debian:14) | < 6.12.37-1 | 6.12.37-1 |
| Linux kernel | >= bf18c7118cf83ad4b9aa476354b4a06bcb9d0c4f, < dd4becd3fd4102696e1c15e6d260a1712a2d8685 | dd4becd3fd4102696e1c15e6d260a1712a2d8685 |
| Linux kernel | >= bf18c7118cf83ad4b9aa476354b4a06bcb9d0c4f, < 90dee0a0ff84fac8accd5be98412b3819f667149 | 90dee0a0ff84fac8accd5be98412b3819f667149 |
| Linux kernel | >= bf18c7118cf83ad4b9aa476354b4a06bcb9d0c4f, < c56b177efce8b62798e4d96bdb9867106cb7c4a0 | c56b177efce8b62798e4d96bdb9867106cb7c4a0 |
| Linux kernel | >= bf18c7118cf83ad4b9aa476354b4a06bcb9d0c4f, < bc0819a25e04cd68ef3568cfa51b63118fea39a7 | bc0819a25e04cd68ef3568cfa51b63118fea39a7 |
| Linux kernel | >= bf18c7118cf83ad4b9aa476354b4a06bcb9d0c4f, < ce23b73f0f27e2dbeb81734a79db710f05aa33c6 | ce23b73f0f27e2dbeb81734a79db710f05aa33c6 |
| Linux kernel | >= bf18c7118cf83ad4b9aa476354b4a06bcb9d0c4f, < 0e5c144c557df910ab64d9c25d06399a9a735e65 | 0e5c144c557df910ab64d9c25d06399a9a735e65 |
| Linux kernel | >= bf18c7118cf83ad4b9aa476354b4a06bcb9d0c4f, < 1d6123102e9fbedc8d25bf4731da6d513173e49e | 1d6123102e9fbedc8d25bf4731da6d513173e49e |
| Linux kernel | = 3.4 | No fix listed |
| Linux kernel | < 5.10.259 | 5.10.259 |
| Linux kernel | < 5.15.209 | 5.15.209 |
| Linux kernel | < 6.1.167 | 6.1.167 |
| Linux kernel | < 6.6.97 | 6.6.97 |
| Linux kernel | < 6.12.36 | 6.12.36 |
| Linux kernel | < 6.15.5 | 6.15.5 |
| Linux kernel | < 6.16 | 6.16 |
| Siemens SIMATIC S7-1500 TM MFP - GNU/Linux subsystem | All versions | No fix listed |
| ubuntu/linux(Ubuntu:22.04) | < 5.15.0-186.196 | 5.15.0-186.196 |
| ubuntu/linux-kvm(Ubuntu:22.04) | < 5.15.0-1104.109 | 5.15.0-1104.109 |
| ubuntu/linux-raspi(Ubuntu:22.04) | < 5.15.0-1106.109 | 5.15.0-1106.109 |
| ubuntu/linux(Ubuntu:24.04) | < 6.8.0-100.100 | 6.8.0-100.100 |
| ubuntu/linux-raspi(Ubuntu:24.04) | < 6.8.0-1047.51 | 6.8.0-1047.51 |
| Linux kernel | >= 3.4, < 6.6.97 | 6.6.97 |
| Linux kernel | >= 6.7, < 6.12.36 | 6.12.36 |
| Linux kernel | >= 6.13, < 6.15.5 | 6.15.5 |
| Linux kernel | = 6.16-rc1 | No fix listed |
| Linux kernel | = 6.16-rc2 | No fix listed |
| Linux kernel | = 6.16-rc3 | No fix listed |
References
- MSRC Security Update Guide vendor-advisory
- CBL-Mariner Releases vendor-advisory
- Debian Security Tracker CVE-2025-38250 vendor-advisory
- git.kernel.org
- git.kernel.org
- git.kernel.org
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- cert-portal.siemens.com
- Ubuntu CVE tracker vendor-advisory
- USN-7833-1 vendor-advisory
- USN-7834-1 vendor-advisory
- USN-7833-2 vendor-advisory
- USN-7833-3 vendor-advisory
- USN-7833-4 vendor-advisory
- USN-7856-1 vendor-advisory
- USN-8028-1 vendor-advisory
- USN-8028-2 vendor-advisory
- USN-8031-1 vendor-advisory
- USN-8028-3 vendor-advisory
- USN-8028-4 vendor-advisory
- USN-8028-5 vendor-advisory
- USN-8031-2 vendor-advisory
- USN-8028-6 vendor-advisory
- USN-8031-3 vendor-advisory
- USN-8052-1 vendor-advisory
- USN-8028-7 vendor-advisory
- USN-8028-8 vendor-advisory
- USN-8052-2 vendor-advisory
- USN-8074-1 vendor-advisory
- USN-8074-2 vendor-advisory
- USN-8126-1 vendor-advisory
- USN-8575-1 vendor-advisory
- USN-8576-1 vendor-advisory
- USN-8575-2 vendor-advisory
- USN-8576-2 vendor-advisory
- USN-8575-3 vendor-advisory
- USN-8610-1 vendor-advisory
- USN-8620-1 vendor-advisory
- USN-8620-2 vendor-advisory
- USN-8620-3 vendor-advisory
- USN-8620-4 vendor-advisory
- USN-8668-1 vendor-advisory
- USN-8668-2 vendor-advisory
- www.cve.org
- ENISA EUVD EUVD-2025-20811 third-party-advisory