CVE-2025-38040 Information
Description
In the Linux kernel the following vulnerability has been resolved:
serial: mctrl_gpio: split disable_ms into sync and no_sync APIs
The following splat has been observed on a SAMA5D27 platform using atmel_serial:
BUG: sleeping function called from invalid context at kernel/irq/manage.c:738
in_atomic(): 1 irqs_disabled(): 128 non_block: 0 pid: 27 name: kworker/u5:0
preempt_count: 1 expected: 0
INFO: lockdep is turned off.
irq event stamp: 0
hardirqs last enabled at (0): [<00000000>] 0x0
hardirqs last disabled at (0): [
This warning is emitted when trying to toggle at the highest level some flow control (with serdev_device_set_flow_control) in a device driver. At the lowest level the atmel_serial driver is using serial_mctrl_gpio lib to enable/disable the corresponding IRQs accordingly. The warning emitted by CONFIG_DEBUG_ATOMIC_SLEEP is due to disable_irq (called in mctrl_gpio_disable_ms) being possibly called in some atomic context (some tty drivers perform modem lines configuration in regions protected by port lock).
Split mctrl_gpio_disable_ms into two differents APIs a non-blocking one and a blocking one. Replace mctrl_gpio_disable_ms calls with the relevant version depending on whether the call is protected by some port lock.
Reference
https://git.kernel.org/stable/c/1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685 https://git.kernel.org/stable/c/68435c1fa3db696db4f480385db9e50e26691d0d https://git.kernel.org/stable/c/7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a https://git.kernel.org/stable/c/c504c11b94d6e4ad818ca5578dffa8ff29ad0f20 https://git.kernel.org/stable/c/e6a46719a2369eb5186d4f7e6c0478720ca1ec3d
Related CNNVD
CNNVD-202506-2177 (Published: 2025-06-18)
Share on: