Skip to main content
Vulnerability Database/CVE-2024-53237

CVE-2024-53237: Linux Kernel Use-After-Free Vulnerability

CVE-2024-53237 is a use-after-free flaw in the Linux Kernel Bluetooth subsystem that can cause system instability through dangling pointers. This article covers technical details, affected versions, and mitigation.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-53237 Overview

CVE-2024-53237 is a use-after-free vulnerability [CWE-416] in the Linux kernel Bluetooth subsystem. The flaw resides in the hci_conn_del_sysfs() code path and was reported by Syzbot via a KASAN slab-use-after-free splat in device_for_each_child(). When device_unregister() is called while an underlying kobject reference count is greater than one, reparenting is delayed. During this delay the parent HCI controller device (hciX) can be freed, leaving a dangling pointer that the kernel later dereferences. A local authenticated attacker can trigger the condition to corrupt kernel memory, escalate privileges, or crash the host.

Critical Impact

Local attackers with low privileges can exploit this Bluetooth subsystem use-after-free to achieve kernel memory corruption, potentially leading to privilege escalation or denial of service on affected Linux systems.

Affected Products

  • Linux Kernel (multiple stable branches prior to the fixing commits)
  • Debian LTS distributions shipping affected kernels
  • Any distribution using the Linux kernel Bluetooth (BNEP/HCI) subsystem

Discovery Timeline

  • 2024-12-27 - CVE-2024-53237 published to NVD
  • 2026-08-04 - Last updated in NVD database

Technical Details for CVE-2024-53237

Vulnerability Analysis

The vulnerability is a use-after-free [CWE-416] in the Bluetooth Host Controller Interface (HCI) connection teardown logic. KASAN detected the slab-use-after-free in device_for_each_child() while the kbnepd bnep0 kernel thread was tearing down a Bluetooth Network Encapsulation Protocol (BNEP) session.

The allocation path originates from hci_alloc_dev_priv() invoked by __vhci_create_device() through vhci_write(). The free path runs through hci_release_dev() -> bt_host_release() -> device_release() -> kobject_put() when vhci_release() is reached during __fput() on process exit.

Between allocation and free, unregister_netdevice_queue() calls netdev_unregister_kobject(), which invokes pm_runtime_set_memalloc_noio() and iterates child devices via device_for_each_child(). If the parent HCI controller has already been freed but the child was not yet reparented, this iteration dereferences freed memory.

Root Cause

In hci_conn_del_sysfs(), device_unregister() may run while a kobject reference count remains above one. The automatic reparenting that normally occurs at final device free is delayed. During this window, the parent HCI controller device (hciX) can be released, so later traversal from the child via device_for_each_child() reads a dangling parent pointer. The fix explicitly reparents to NULL before unregistration to eliminate the dangling reference.

Attack Vector

Exploitation requires local access and the ability to interact with the Bluetooth stack, including the virtual HCI (vhci) and BNEP interfaces. An attacker races the HCI device release against BNEP session unregistration. The condition is reachable without special capabilities on systems where unprivileged users can open BNEP sockets or interact with Bluetooth devices. Successful exploitation can corrupt kernel slab memory, enabling privilege escalation or a kernel panic.

No public proof-of-concept exploit is listed in Exploit-DB, and the issue is not on the CISA Known Exploited Vulnerabilities catalog. The original Syzbot reproducer demonstrates the race in prose; see the referenced kernel commits for technical details of the fix.

Detection Methods for CVE-2024-53237

Indicators of Compromise

  • Kernel log entries containing KASAN: slab-use-after-free in device_for_each_child on hosts running debug kernels.
  • Unexpected oops or panic traces referencing pm_runtime_set_memalloc_noio, netdev_unregister_kobject, or bnep_session.
  • Repeated BNEP session creation and teardown activity from unprivileged user processes.

Detection Strategies

  • Monitor kernel ring buffer (dmesg, /var/log/kern.log) for Bluetooth stack crashes and KASAN reports.
  • Audit process executions that open /dev/vhci or interact with the BNEP interface using auditd rules.
  • Track running kernel versions across the fleet and flag hosts on unpatched stable branches.

Monitoring Recommendations

  • Collect kernel crash dumps and forward them to a central log pipeline for correlation.
  • Alert on repeated bnep0 thread crashes or Bluetooth subsystem reinitializations on a single host.
  • Baseline normal Bluetooth usage per host class and flag deviations such as scripted BNEP session churn.

How to Mitigate CVE-2024-53237

Immediate Actions Required

  • Apply the upstream Linux kernel patches referenced in the kernel.org commits and reboot affected systems.
  • On Debian LTS systems, install the kernel updates described in the Debian LTS announcement.
  • Where Bluetooth is not required, disable the bluetooth and bnep kernel modules to remove the attack surface.

Patch Information

Fixes are available in multiple stable branches via commits 0f67ca2a, 27aabf27, 7b277bd5, 91e2a2e4, a9584c89, de5a44f3, and fb91ce37. The patch explicitly reparents the HCI device to NULL before unregistration, preventing the dangling parent pointer.

Workarounds

  • Blacklist the bluetooth, bnep, and vhci modules on hosts that do not need Bluetooth networking.
  • Restrict access to /dev/vhci and Bluetooth management interfaces to trusted users only.
  • Remove CAP_NET_ADMIN and Bluetooth group memberships from untrusted local accounts.
bash
# Configuration example: disable vulnerable Bluetooth modules
echo 'blacklist bluetooth' | sudo tee /etc/modprobe.d/disable-bluetooth.conf
echo 'blacklist bnep' | sudo tee -a /etc/modprobe.d/disable-bluetooth.conf
echo 'install vhci /bin/true' | sudo tee -a /etc/modprobe.d/disable-bluetooth.conf
sudo systemctl disable --now bluetooth.service
sudo update-initramfs -u

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.