KernelScan.io

HIGH Introduced in 3.15

bluetooth PortRef UAF

CVE-2026-98739

CVSS 7.0 / 10.0 KernelScan AI

CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H

01

In the Linux kernel, the following vulnerability has been resolved: Bluetooth: RFCOMM: Fix initial port reference race For RFCOMM_RELEASE_ONHUP devices, rfcomm_tty_install() and __rfcomm_release_dev() both use RFCOMM_TTY_OWNED to decide who drops the initial tty_port reference. The release path tests the bit separately from the install path setting it, so both can drop that reference. The synchronous hangup does not prevent this race: port->tty is not assigned until tty_port_open(), after installation. The following interleaving is possible: 1. Install and release each obtain a reference with rfcomm_dev_get(). 2. Release observes RFCOMM_TTY_OWNED clear. 3. Install sets RFCOMM_TTY_OWNED and drops the initial reference. 4. Release drops the same initial reference again. 5. TTY cleanup drops its reference and frees the device. 6. Release performs its final tty_port_put() on the freed port. KASAN reported: BUG: KASAN: slab-use-after-free in tty_port_put+0x22/0x190 Write of size 4 at addr ffff8881001d3d5c by task poc/92 Call Trace: tty_port_put+0x22/0x190 rfcomm_dev_ioctl+0x1d4/0x1930 sock_do_ioctl+0x110/0x260 sock_ioctl+0x380/0x590 __x64_sys_ioctl+0x134/0x1c0 Allocated by task 88: rfcomm_dev_ioctl+0x8f6/0x1930 sock_do_ioctl+0x110/0x260 sock_ioctl+0x380/0x590 __x64_sys_ioctl+0x134/0x1c0 Freed by task 65: kfree+0x131/0x3c0 rfcomm_dev_destruct+0x23b/0x2f0 release_one_tty+0xc1/0x370 process_one_work+0x661/0x1090 Use test_and_set_bit() in both paths so that only the caller that changes RFCOMM_TTY_OWNED from clear to set drops the initial reference. Each path keeps its own lookup reference until release or TTY cleanup, preserving the existing callback ordering and error handling.

02

Engine v0.9.0

Risk summary

A local attacker with access to the Bluetooth RFCOMM subsystem can trigger a use-after-free by racing a TTY install against a device release. This leads to kernel memory corruption, enabling privilege escalation or denial of service. Systems with Bluetooth enabled and untrusted local users are at risk.

Affectednet/bluetooth/rfcomm/tty.c (Bluetooth RFCOMM)

Vulnerability analysis

In the Bluetooth RFCOMM driver, devices configured with RFCOMM_RELEASE_ONHUP have their initial tty_port reference managed by two concurrent paths: the TTY install routine and the device release ioctl. Both paths independently check and set a status bit (RFCOMM_TTY_OWNED) to decide who drops that reference, but the check and set were not atomic. This allows a race where both paths observe the bit as clear and each drops the reference, causing a double-free of the port structure. The subsequent TTY cleanup then operates on freed memory, resulting in a use-after-free. The fix makes the bit test-and-set atomic in both paths so only the first caller drops the initial reference. An attacker needs local access to open a Bluetooth RFCOMM socket and issue the relevant ioctls, which is typically available to users in the bluetooth group or with CAP_NET_ADMIN (including inside user namespaces).

03

BranchIntroducedFixed inPatch commit
5.103.155.10.273cd247e38b14d
5.153.155.15.224d3dd18e85c14
6.13.156.1.191c50360a01976
6.123.156.12.113a03ccf1ab773
6.183.156.18.560a554901bd22
6.63.156.6.16055d162aa00d1
7.23.157.2.10e5aa7fbf7a44
mainline3.157.32d696c1ed346
cip/6.123.156.12.114-cip34a03ccf1ab773

04

State of the newest release of each Civil Infrastructure Platform SLTS tree, from CIP's own fix records.

CIP treeState
cip/6.12Fixed in 6.12.114-cip34
cip/6.1Affected — no CIP fix yet (latest 6.1.190-cip62)
cip/6.1-rtAffected — no CIP fix yet (latest 6.1.189-cip61-rt32)
cip/5.10Affected — no CIP fix yet (latest 5.10.272-cip79)
cip/5.10-rtAffected — no CIP fix yet (latest 5.10.272-cip79-rt35)
cip/4.19Affected — no CIP fix yet (latest 4.19.325-cip136)
cip/4.19-rtAffected — no CIP fix yet (latest 4.19.325-cip136-rt50)
cip/4.4Affected — no CIP fix yet (latest 4.4.302-cip115)
cip/4.4-rtAffected — no CIP fix yet (latest 4.4.302-cip115-rt63)