CVE-2026-97480: tty: serial: 8250: protect against NULL uart->port.dev in register
In the Linux kernel, the following vulnerability has been resolved:
tty: serial: 8250: protect against NULL uart->port.dev in register
serial8250register8250port() conditionally copies uart->port.dev from up->port.dev only when up->port.dev is non-NULL:
if (up->port.dev) { uart->port.dev = up->port.dev; ... }
So if both the existing uart slot and up have a NULL ->dev, uart->port.dev remains NULL. The very next ACPI companion check then dereferences it unconditionally:
if (!hasacpicompanion(uart->port.dev)) {
hasacpicompanion() reads dev->fwnode without a NULL guard (include/linux/acpi.h), so this NULL-derefs the kernel for the remaining no-dev case rather than just skipping the mctrlgpioinit() initialisation as intended.
smatch flags the inconsistency:
drivers/tty/serial/8250/8250core.c:767 serial8250register8250port() error: 'uart->port.dev' could be null (see line 719)
Guard the call with a NULL check so register continues to work for callers that legitimately have no parent device (legacy non-OF/non-ACPI registrations).
No functional change for callers that pass a non-NULL ->dev.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In serial8250_register_8250_port(), guard the has_acpi_companion(uart->port.dev) call with a NULL check so it is only called when uart->port.dev is non-NULL, preventing NULL dereferences for registrations without a parent device.
Event History
Frequently Asked Questions
Which systems are realistically exposed to this issue?
Systems that register an 8250 serial port without a parent device are exposed, specifically legacy non-OF/non-ACPI registration paths where both the existing UART slot and the supplied port have a NULL dev pointer. Callers that provide a non-NULL dev pointer are not functionally affected by this condition.
What is required to trigger the failure?
A call to serial8250_register_8250_port() must reach the ACPI companion check with uart->port.dev still NULL. The unconditional has_acpi_companion() call then dereferences the NULL device pointer, causing a kernel NULL-pointer dereference.
How can I determine whether a crash is related to this vulnerability?
Look for a kernel crash during 8250 serial-port registration with has_acpi_companion() in the call path and a NULL dereference involving dev->fwnode. The affected registration case has no parent device assigned to the UART port.