CVE-2025-38040

Source
https://cve.org/CVERecord?id=CVE-2025-38040
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38040.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-38040
Downstream
Related
Published
2025-06-18T09:33:25.720Z
Modified
2026-03-11T07:44:20.375378Z
Summary
serial: mctrl_gpio: split disable_ms into sync and no_sync APIs
Details

In the Linux kernel, the following vulnerability has been resolved:

serial: mctrlgpio: split disablems 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 inatomic(): 1, irqsdisabled(): 128, nonblock: 0, pid: 27, name: kworker/u5:0 preemptcount: 1, expected: 0 INFO: lockdep is turned off. irq event stamp: 0 hardirqs last enabled at (0): [<00000000>] 0x0 hardirqs last disabled at (0): [<c01588f0>] copyprocess+0x1c4c/0x7bec softirqs last enabled at (0): [<c0158944>] copyprocess+0x1ca0/0x7bec softirqs last disabled at (0): [<00000000>] 0x0 CPU: 0 UID: 0 PID: 27 Comm: kworker/u5:0 Not tainted 6.13.0-rc7+ #74 Hardware name: Atmel SAMA5 Workqueue: hci0 hcipoweron [bluetooth] Call trace: unwindbacktrace from showstack+0x18/0x1c showstack from dumpstacklvl+0x44/0x70 dumpstack_lvl from __might_resched+0x38c/0x598 _mightresched from disableirq+0x1c/0x48 disableirq from mctrlgpiodisablems+0x74/0xc0 mctrlgpiodisablems from atmeldisablems.part.0+0x80/0x1f4 atmeldisablems.part.0 from atmelsettermios+0x764/0x11e8 atmelsettermios from uartchangelinesettings+0x15c/0x994 uartchangelinesettings from uartsettermios+0x2b0/0x668 uartsettermios from ttysettermios+0x600/0x8ec ttysettermios from ttyportsetflowcontrol+0x188/0x1e0 ttyportsetflowcontrol from wilcsetup+0xd0/0x524 [hciwilc] wilcsetup [hciwilc] from hcidevopensync+0x330/0x203c [bluetooth] hcidevopensync [bluetooth] from hcidevdoopen+0x40/0xb0 [bluetooth] hcidevdoopen [bluetooth] from hcipoweron+0x12c/0x664 [bluetooth] hcipoweron [bluetooth] from processonework+0x998/0x1a38 processonework from workerthread+0x6e0/0xfb4 workerthread from kthread+0x3d4/0x484 kthread from retfromfork+0x14/0x28

This warning is emitted when trying to toggle, at the highest level, some flow control (with serdevdevicesetflowcontrol) in a device driver. At the lowest level, the atmelserial driver is using serialmctrlgpio lib to enable/disable the corresponding IRQs accordingly. The warning emitted by CONFIGDEBUGATOMICSLEEP is due to disableirq (called in mctrlgpiodisablems) being possibly called in some atomic context (some tty drivers perform modem lines configuration in regions protected by port lock).

Split mctrlgpiodisablems into two differents APIs, a non-blocking one and a blocking one. Replace mctrlgpiodisablems calls with the relevant version depending on whether the call is protected by some port lock.

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38040.json"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
ce59e48fdbad2aa6609ceb87e1306ec69e577e05
Fixed
68435c1fa3db696db4f480385db9e50e26691d0d
Fixed
c504c11b94d6e4ad818ca5578dffa8ff29ad0f20
Fixed
e6a46719a2369eb5186d4f7e6c0478720ca1ec3d
Fixed
7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a
Fixed
1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38040.json"