Skip to main content
Vulnerability Database/CVE-2026-98747

CVE-2026-98747: Linux Kernel Use-After-Free Vulnerability

CVE-2026-98747 is a use-after-free vulnerability in the Linux kernel serial core that causes NULL pointer dereference during port unregistration. 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-2026-98747 Overview

CVE-2026-98747 is a NULL pointer dereference vulnerability in the Linux kernel's serial core subsystem. The flaw resides in serial_core_unregister_port(), which passes port->port_dev to serial_core_get_ctrl_dev() without verifying the pointer. The port_dev field is NULL when no port device has been installed, either because teardown has cleared it or because registration failed before serial_core_port_device_add() executed. Kernel Address Sanitizer (KASAN) traces confirm a null-ptr-deref in the range [0x40-0x47] reachable through serial8250_unregister_port, serial8250_remove, and unbind_store. The upstream fix returns early when no port device exists and reads port->port_dev under port_mutex.

Critical Impact

Local kernel-mode NULL pointer dereference leading to denial of service through serial port unbind operations on affected Linux systems.

Affected Products

  • Linux kernel versions containing the affected serial_core_unregister_port() code path
  • Systems using the serial8250 driver
  • Distributions shipping unpatched upstream kernels

Discovery Timeline

  • 2026-10-18 - CVE-2026-98747 published to NVD
  • 2026-10-19 - Last updated in NVD database

Technical Details for CVE-2026-98747

Vulnerability Analysis

The vulnerability is a NULL pointer dereference [CWE-476] in the Linux kernel serial core subsystem. The serial_core_unregister_port() function unconditionally forwards port->port_dev to serial_core_get_ctrl_dev(), which dereferences the pointer to reach the controlling device structure. When the serial port has no associated port device, that pointer is NULL and the dereference faults inside the kernel.

Two code paths produce the NULL state. First, teardown clears port->port_dev after the device is removed. Second, if registration fails before serial_core_port_device_add() runs, the field was never assigned. Either path leaves subsequent unregister calls exposed. KASAN reports an out-of-range access at offsets 0x40-0x47, consistent with reading a struct member from a NULL base pointer.

Root Cause

The root cause is missing NULL validation combined with unsynchronized access to port->port_dev. The field changes state during register and unregister flows, but the unregister path neither checks for NULL nor acquires port_mutex before reading it. The upstream patch adds an early return when no port device is present and relocates the read inside the port_mutex critical section. The fix also clears port->port_dev on the serial_core_register_port() error path, where the port device has already been removed.

Attack Vector

Triggering the fault requires local access to invoke the serial driver unbind interface, typically through sysfs (unbind_store) or by removing an 8250 port. An attacker or buggy userspace with sufficient privileges to interact with these interfaces can crash the kernel, resulting in denial of service. See the Linux Kernel Commit 499485a and Linux Kernel Commit 54abbb8 for the upstream fix.

Detection Methods for CVE-2026-98747

Indicators of Compromise

  • Kernel oops or panic logs referencing serial_core_unregister_port in the call trace
  • KASAN reports of null-ptr-deref in range [0x0000000000000040-0x0000000000000047]
  • Call stacks including serial8250_unregister_port, serial8250_remove, or unbind_store

Detection Strategies

  • Review dmesg and /var/log/kern.log for serial core crash signatures following device unbind operations
  • Correlate kernel crash telemetry with userspace activity against /sys/bus/platform/drivers/*/unbind and similar sysfs entries
  • Audit installed kernel package versions against distribution advisories referencing the upstream commits

Monitoring Recommendations

  • Alert on unexpected kernel panics on systems with serial hardware or virtual serial ports
  • Track write operations to driver unbind sysfs entries by non-administrative processes
  • Monitor kernel package inventory for unpatched builds across the fleet

How to Mitigate CVE-2026-98747

Immediate Actions Required

  • Apply the upstream kernel patches from commits 499485a and 54abbb8 or install vendor-provided kernel updates
  • Restrict access to driver unbind sysfs interfaces to privileged administrative accounts only
  • Prioritize patching on hosts that expose serial devices to multi-tenant or less-trusted workloads

Patch Information

The fix is published in the mainline Linux kernel. Reference Linux Kernel Commit 499485a and Linux Kernel Commit 54abbb8. The patch returns early when port->port_dev is NULL, reads the pointer under port_mutex, and clears port->port_dev on the register error path.

Workarounds

  • Avoid issuing unbind operations against serial8250 ports on unpatched kernels
  • Remove or blacklist unused serial drivers via modprobe configuration where feasible
  • Constrain sysfs permissions so only trusted administrators can trigger driver teardown
bash
# Verify running kernel and check for the fix
uname -r
# Restrict permissions on driver unbind interfaces (example)
chmod 600 /sys/bus/platform/drivers/*/unbind

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.