bitVakt

Kernel Kit / Infix / v26.10.0latest

CVE-2026-98747

—unknown

linux6.18.60 · 6.18.54 · 6.18.8 · 6.12.21in 4 of 4 releases

Not yet analysed by NVD. Matched on the vendor's record; this may change when NVD has analysed it.

Reach linux · 8 builds in 4 of 4 releases

full reviewcross-check✓ a member decided

Description · NVD

serial: core: fix NULL pointer dereference in serial_core_unregister_port()

port->port_dev is NULL when no port device is installed: it is cleared on teardown, and never set if registration failed before serial_core_port_device_add(). serial_core_unregister_port() passes it straight to serial_core_get_ctrl_dev(), which dereferences it:

  KASAN: null-ptr-deref in range [0x0000000000000040-0x0000000000000047]
  RIP: serial_core_unregister_port
  Call Trace:
   serial8250_unregister_port
   serial8250_remove
   unbind_store

Return early when there is no port device, and read port->port_dev under port_mutex.

Also clear port->port_dev on the serial_core_register_port() error path, where the port device has already been removed.

Published 2026-10-18NVD

References 2
Review Av26.10.0x86_64Not exposedFable 5.2 · medium confidence · 2026-11-19

The vulnerable code is in this build and unfixed: serial_core_unregister_port() in drivers/tty/serial/serial_core.c still passes port->port_dev straight to serial_core_get_ctrl_dev() before taking port_mutex, with no NULL check. CONFIG_SERIAL_CORE=y and CONFIG_SERIAL_8250=y are built in, and no applied patch touches the function.

The function only runs when a UART port is unregistered, and it only crashes if that port has no port device (an earlier registration failed, or it was already torn down). Nothing in the factory-default boot unregisters a UART, and I found no YANG node, CLI command or web UI action that unbinds or removes a serial driver. Reaching it needs a root shell writing to a sysfs unbind or PCI remove file, as in the CVE's unbind_store trace, or physical removal of a serial device; it is not reachable from a network interface.

If it were triggered, the result is a local denial of service: CONFIG_PANIC_ON_OOPS=y turns the NULL dereference into a panic and reboot.

Evidence 12
  1. `serial_core_unregister_port()` reads `port->port_dev` (line 3385) and calls `serial_core_get_ctrl_dev(port_dev)` (line 3386) before `mutex_lock(&port_mutex)` (line 3389), with no NULL check. This is the pre-fix code.

    output/build/linux-6.18.60/drivers/tty/serial/serial_core.c:3382-3403

  2. `serial_core_get_ctrl_dev()` takes `&port_dev->dev` and goes on to use it, which is the NULL-pointer dereference the CVE describes.

    output/build/linux-6.18.60/drivers/tty/serial/serial_core.c:3273-3275

  3. `uport->port_dev = NULL` on teardown, so a port that has been removed, or never got a port device, carries a NULL pointer into the next unregister.

    output/build/linux-6.18.60/drivers/tty/serial/serial_core.c:3230

  4. The `err_unregister_port_dev` error path in `serial_core_register_port()` removes the port device but does not clear `port->port_dev`; the third part of the fix is also missing.

    output/build/linux-6.18.60/drivers/tty/serial/serial_core.c:3369-3370

  5. The source is plain 6.18.60 (`VERSION = 6`, `PATCHLEVEL = 18`, `SUBLEVEL = 60`).

    output/build/linux-6.18.60/Makefile:2-4

  6. The only serial/UART-related entry among the applied patches is `0087-riscv-dts-spacemit-add-UART-pinctrl-combinations.patch`, a device-tree change. A search of `patches/linux/6.18.60/` for `serial_core` or `port_dev` hits only `0131-net-sparx5-add-LAG-offload.patch`, which is unrelated.

    output/build/linux-6.18.60/.applied_patches_list:87

  7. `CONFIG_SERIAL_8250=y`, `CONFIG_SERIAL_8250_PCI=y` and `CONFIG_SERIAL_CORE=y`: serial core and the 8250 drivers are built into the kernel image.

    output/build/linux-6.18.60/.config:2666,2673,2691

  8. `8250_platform.o`, `8250_core.o` and `serial_core.o` were all produced by the build.

    output/objects.txt:22698,22702,22705

  9. `serial8250_remove()` calls `serial8250_unregister_port()`, which calls `uart_remove_one_port()`. This is the call chain in the CVE trace and it runs only on driver unbind or device removal.

    output/build/linux-6.18.60/drivers/tty/serial/8250/8250_platform.c:236-246 and 8250_core.c:868-892

  10. The default kernel command line uses `console=ttyS0 console=hvc0`: the 8250 port is registered and used as console at boot, but nothing here unregisters it.

    board/x86_64/grub.cfg:45

  11. No hits that write a sysfs `unbind` file or unload a serial driver. The only matches are comments about interface, firewall and Wi-Fi handling in `src/confd`, `src/webui` and `src/yangerd`, so no management-interface path leads to UART unregistration.

    board/, src/, package/ (search for `unbind`, `drivers_probe`, `rmmod`, `modprobe -r`)

  12. `CONFIG_PANIC_ON_OOPS=y` (a triggered NULL dereference panics the device); `CONFIG_KASAN`, `CONFIG_USB4` and `CONFIG_PCCARD` are not set, and no `CONFIG_HOTPLUG_PCI=y` line is present, so hot-unplug routes to a PCI UART are limited.

    output/build/linux-6.18.60/.config:4828,4817,4053,1683

Version and patches

The tree is vanilla linux 6.18.60 plus 139 Infix patches, none of which touches drivers/tty/serial/serial_core.c. None of the three parts of the fix is in the source: the early return on a NULL port->port_dev, reading it under port_mutex, and clearing it on the serial_core_register_port() error path.

The upstream fix commits (499485a67fba, 54abbb862366) could not be fetched from this tree, so the exact affected range and the first fixed 6.18.y release are not confirmed. The NVD match to 6.18.60 is consistent with the code as found.

Recommendation

Document as not exposed in the shipped configuration and take the fix with the next routine 6.18.y stable bump that contains it; no out-of-band backport is needed.

If a bump is far off, the fix is small and self-contained in drivers/tty/serial/serial_core.c, so it could be dropped into patches/linux/6.18.60/ as a low-risk backport.

Impact if triggered is a local, root-only denial of service (panic and reboot via CONFIG_PANIC_ON_OOPS=y), with no network vector.

Open questions

Which 6.18.y stable release first contains the fix, and the exact affected range, need checking against the kernel CNA record or the stable commits; they are not available offline.

I did not exhaustively trace every in-kernel caller that can unregister a UART without root action, such as probe-failure paths in 8250_pci, 8250_exar, 8250_lpss or 8250_mid on specific hardware. On the x86_64 target these would need particular PCI UART hardware and a registration failure, so they are unlikely to change the verdict.

My first, combined search command was blocked by the sandbox and I re-ran it as separate read-only commands; nothing was left unchecked as a result.

Members of Kernel Kit decide. Sign in if you are one.