CVE-2026-139640: serial: 8250_mxpcie: set the driver data before registering ports
In the Linux kernel, the following vulnerability has been resolved:
serial: 8250mxpcie: set the driver data before registering ports
mxpcie8250rs485config() looks the board up with devgetdrvdata() on the PCI device, but pcisetdrvdata() only runs after the registration loop. Where mxpcie8250setupport() presets rs485.flags to SERRS485ENABLED and the flag survives uartgetrs485mode() - the device has no firmware node, or its node sets linux,rs485-enabled-at-boot-time - uartconfigureport() calls ->rs485config() from inside serial8250register8250port(), and the callback dereferences a NULL board pointer.
Publish the driver data before the first port is registered.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
Set the PCI device's driver data before registering the first port, so mxpcie8250_rs485_config() can retrieve the board pointer.
Event History
Frequently Asked Questions
Which systems are exposed to this issue?
Systems using the Linux kernel mxpcie 8250 serial driver are exposed when a port has RS-485 enabled at boot. This can occur when the device has no firmware node or when its firmware node sets linux,rs485-enabled-at-boot-time.
What triggers the failure?
The failure occurs during port registration when the serial core invokes the driver's RS-485 configuration callback. The callback retrieves board data from the PCI device before that driver data has been set, resulting in a NULL pointer dereference.
How can I determine whether a system may be affected?
Check whether the mxpcie 8250 driver is in use and whether its serial ports are configured with SER_RS485_ENABLED during initialization. The described conditions include absent firmware-node information or a firmware node declaring linux,rs485-enabled-at-boot-time.