CVE-2026-139371: Bluetooth: MSFT: Serialize handle map cleanup with event processing

Published Nov 30, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

Bluetooth: MSFT: Serialize handle map cleanup with event processing

MSFT monitor handle mappings must remain valid while vendor events look up and use them under hdev->lock. msftdoclose() removes and frees the mappings without that lock.

hcidevclosesync() clears HCIUP and drains the RX workqueue before MSFT cleanup. However, a transport callback that already passed hcirecvframe()'s state check can queue a vendor event after the drain returns, if no earlier shutdown callback has quiesced reception. The driver close callback runs after MSFT cleanup, so event processing can overlap the unlocked removal. msftmonitordeviceevt() can then traverse freed list entries or read handledata->mgmthandle after it is freed.

Take hdev->lock while resetting monitor states and removing handle mappings in msftdoclose(), as normal monitor cancellation already does. An active event reader then finishes before its mapping is freed, and later lookups see an empty handle map.

An instrumented kernel produced this KASAN report (timestamps removed and unrelated frames omitted):

BUG: KASAN: slab-use-after-free in msftvendorevt+0x1906/0x1990 Read of size 2 at addr ffff888104df3602 by task kworker/u17:2/502

Workqueue: hci0 hcirxwork Call Trace: [...] msftvendorevt+0x1906/0x1990 hcivendorevt+0x6f/0x90 hcieventpacket+0x894/0xc70 [...] hcirxwork+0x3f8/0xfa0 [...]

Allocated by task 499: [...] msftaddmonitorsync+0x6a8/0x10a0 msftaddmonitorpattern+0x7f/0xb0 hciaddadvmonitor+0x1fa/0x2e0 [...]

Freed by task 499: [...] kfree+0x307/0x580 msftdoclose+0x238/0x750 hcidevclosesync+0x546/0x1380 [...]

The buggy address belongs to the object at ffff888104df3600 which belongs to the cache kmalloc-32 of size 32 The buggy address is located 2 bytes inside of freed 32-byte region [ffff888104df3600, ffff888104df3620) [...]

Affected Software

1 affected component
Linux Linux kernel

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Compensating control

    In msft_do_close(), take hdev->lock while resetting monitor states and removing handle mappings, so cleanup is serialized with event processing.

Event History

Nov 30, 2026
CVE Published
via MITRE·01:34 PM
Data Sourced
via MITRE·01:34 PM
Description
Data Sourced
via NVD·02:19 PM
Description

Frequently Asked Questions

1

What conditions are required for this race to occur?

A Bluetooth transport callback must already have passed hci_recv_frame()'s state check and queue a Microsoft vendor event after hci_dev_close_sync() has drained the RX workqueue. This can overlap with msft_do_close() removing handle mappings without hdev->lock.

2

What is the practical impact if the race is triggered?

Vendor-event processing can traverse freed handle-map list entries or read handle_data->mgmt_handle after the underlying object has been freed. The reported failure mode is a KASAN-detected slab use-after-free in msft_vendor_evt.

3

How does the fix prevent the issue?

The fix takes hdev->lock while msft_do_close() resets monitor states and removes handle mappings. Any active event reader completes before its mapping is freed, and subsequent lookups find an empty handle map.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203