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 dumpstacklvl from _mightresched+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 retfrom_fork+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.
[
{
"digest": {
"line_hashes": [
"170272349796429275396221787674795244246",
"43702628474798734341324538715068883004",
"117687809362047600754745338712891761592",
"75224214039193016920997211362008924937"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/stm32-usart.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685",
"id": "CVE-2025-38040-1015137c",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"285694410954461196263310910029273748740",
"292549163678118758519560638069343666504",
"253603423776936480783713913550846244294",
"336932057673327983599513923367368257801",
"74298000575731929270517048827473573541",
"262168359887568074116657097811834924157",
"48545512070786322120990865277678265284",
"181475287113404557930761065628357850496"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a",
"id": "CVE-2025-38040-1ab57844",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"178446381786688826906386271424446438084",
"337289748887054803732348604018340078467",
"313678491589373623654344411642285534433",
"320460116704742545932101271314399420526"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/sh-sci.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a",
"id": "CVE-2025-38040-1e4da3bb",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"299681817176584486154571040792487637823",
"190437974950351627204348984244854274339",
"253603423776936480783713913550846244294",
"336932057673327983599513923367368257801",
"74298000575731929270517048827473573541",
"262168359887568074116657097811834924157",
"48545512070786322120990865277678265284",
"181475287113404557930761065628357850496"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685",
"id": "CVE-2025-38040-272f485e",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"170272349796429275396221787674795244246",
"43702628474798734341324538715068883004",
"117687809362047600754745338712891761592",
"75224214039193016920997211362008924937"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/stm32-usart.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a",
"id": "CVE-2025-38040-2a9f2fae",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"224108331456808701928916655229542070656",
"182189094558861277547323014709386776021",
"323745342277923473060830857178084963816",
"157503560226742092608642800553096927410"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/8250/8250_port.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a",
"id": "CVE-2025-38040-2e35b72f",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"224108331456808701928916655229542070656",
"182189094558861277547323014709386776021",
"323745342277923473060830857178084963816",
"157503560226742092608642800553096927410"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/8250/8250_port.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6a46719a2369eb5186d4f7e6c0478720ca1ec3d",
"id": "CVE-2025-38040-30e616fe",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"285694410954461196263310910029273748740",
"292549163678118758519560638069343666504",
"253603423776936480783713913550846244294",
"336932057673327983599513923367368257801",
"74298000575731929270517048827473573541",
"262168359887568074116657097811834924157",
"48545512070786322120990865277678265284",
"181475287113404557930761065628357850496"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6a46719a2369eb5186d4f7e6c0478720ca1ec3d",
"id": "CVE-2025-38040-357d9163",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"132464941167661337673515455047695157971",
"60728847938548784270924427697453592430",
"51916728710447292130995657509418091507",
"202642664994178399450045404384122102694",
"777764097240557789056838227431315409",
"189777019644737153410848741829107056979",
"328751130476208204121376740511585917952",
"14584809326321336517331186298066339549",
"20467803623922132170199013126014515988",
"216904052991952720835106823384931363799",
"306849976541059084449943657268705493682"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c504c11b94d6e4ad818ca5578dffa8ff29ad0f20",
"id": "CVE-2025-38040-47b951b5",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"170272349796429275396221787674795244246",
"43702628474798734341324538715068883004",
"117687809362047600754745338712891761592",
"75224214039193016920997211362008924937"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/stm32-usart.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c504c11b94d6e4ad818ca5578dffa8ff29ad0f20",
"id": "CVE-2025-38040-48fcb85d",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"311496303355351851091939656592435707592",
"146879872174431541753856191210543871890",
"299618632614827900156271575906800456606",
"22206910187138293304842576059697992209"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/atmel_serial.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6a46719a2369eb5186d4f7e6c0478720ca1ec3d",
"id": "CVE-2025-38040-4aa9de80",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"250170251853664210536720833369113176580",
"230066832946409072657591543494558915114",
"290759768303870081169497121878299897405",
"161679032901737729120383382741479273795"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/imx.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a",
"id": "CVE-2025-38040-523acd62",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"132464941167661337673515455047695157971",
"60728847938548784270924427697453592430",
"51916728710447292130995657509418091507",
"202642664994178399450045404384122102694",
"777764097240557789056838227431315409",
"189777019644737153410848741829107056979",
"328751130476208204121376740511585917952",
"14584809326321336517331186298066339549",
"20467803623922132170199013126014515988",
"216904052991952720835106823384931363799",
"306849976541059084449943657268705493682"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6a46719a2369eb5186d4f7e6c0478720ca1ec3d",
"id": "CVE-2025-38040-55fb9cc6",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"132464941167661337673515455047695157971",
"60728847938548784270924427697453592430",
"51916728710447292130995657509418091507",
"202642664994178399450045404384122102694",
"777764097240557789056838227431315409",
"189777019644737153410848741829107056979",
"328751130476208204121376740511585917952",
"14584809326321336517331186298066339549",
"20467803623922132170199013126014515988",
"216904052991952720835106823384931363799",
"306849976541059084449943657268705493682"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a",
"id": "CVE-2025-38040-586a7395",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"311496303355351851091939656592435707592",
"146879872174431541753856191210543871890",
"299618632614827900156271575906800456606",
"22206910187138293304842576059697992209"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/atmel_serial.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685",
"id": "CVE-2025-38040-625e6dd0",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"178446381786688826906386271424446438084",
"337289748887054803732348604018340078467",
"313678491589373623654344411642285534433",
"320460116704742545932101271314399420526"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/sh-sci.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6a46719a2369eb5186d4f7e6c0478720ca1ec3d",
"id": "CVE-2025-38040-68f33e3b",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"178446381786688826906386271424446438084",
"337289748887054803732348604018340078467",
"313678491589373623654344411642285534433",
"320460116704742545932101271314399420526"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/sh-sci.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685",
"id": "CVE-2025-38040-75439b5a",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"95575030197576113663120970841209281914",
"39971709000755179384534461903912899840",
"325279436268525043452595295932058030664",
"139379665896821735325608154738689729946"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/imx.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c504c11b94d6e4ad818ca5578dffa8ff29ad0f20",
"id": "CVE-2025-38040-82e3f831",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"224108331456808701928916655229542070656",
"182189094558861277547323014709386776021",
"323745342277923473060830857178084963816",
"157503560226742092608642800553096927410"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/8250/8250_port.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c504c11b94d6e4ad818ca5578dffa8ff29ad0f20",
"id": "CVE-2025-38040-967b31d3",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"311496303355351851091939656592435707592",
"146879872174431541753856191210543871890",
"299618632614827900156271575906800456606",
"22206910187138293304842576059697992209"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/atmel_serial.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a",
"id": "CVE-2025-38040-998a93dd",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"311496303355351851091939656592435707592",
"146879872174431541753856191210543871890",
"299618632614827900156271575906800456606",
"22206910187138293304842576059697992209"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/atmel_serial.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c504c11b94d6e4ad818ca5578dffa8ff29ad0f20",
"id": "CVE-2025-38040-a99775dc",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"285694410954461196263310910029273748740",
"292549163678118758519560638069343666504",
"253603423776936480783713913550846244294",
"336932057673327983599513923367368257801",
"74298000575731929270517048827473573541",
"262168359887568074116657097811834924157",
"48545512070786322120990865277678265284",
"181475287113404557930761065628357850496"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.h"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c504c11b94d6e4ad818ca5578dffa8ff29ad0f20",
"id": "CVE-2025-38040-ab65b79f",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"length": 270.0,
"function_hash": "35271962859191959051749456925522743846"
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.c",
"function": "mctrl_gpio_disable_ms"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685",
"id": "CVE-2025-38040-ae5c93ba",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"digest": {
"line_hashes": [
"132464941167661337673515455047695157971",
"60728847938548784270924427697453592430",
"51916728710447292130995657509418091507",
"202642664994178399450045404384122102694",
"777764097240557789056838227431315409",
"189777019644737153410848741829107056979",
"328751130476208204121376740511585917952",
"14584809326321336517331186298066339549",
"20467803623922132170199013126014515988",
"216904052991952720835106823384931363799",
"306849976541059084449943657268705493682"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685",
"id": "CVE-2025-38040-af765e2b",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"length": 270.0,
"function_hash": "35271962859191959051749456925522743846"
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.c",
"function": "mctrl_gpio_disable_ms"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6a46719a2369eb5186d4f7e6c0478720ca1ec3d",
"id": "CVE-2025-38040-c212d96b",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"digest": {
"length": 270.0,
"function_hash": "35271962859191959051749456925522743846"
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.c",
"function": "mctrl_gpio_disable_ms"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7187ec6b0b9ff22ebac2c3bb4178b7dbbdc0a55a",
"id": "CVE-2025-38040-ca39b50e",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"digest": {
"length": 270.0,
"function_hash": "35271962859191959051749456925522743846"
},
"target": {
"file": "drivers/tty/serial/serial_mctrl_gpio.c",
"function": "mctrl_gpio_disable_ms"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c504c11b94d6e4ad818ca5578dffa8ff29ad0f20",
"id": "CVE-2025-38040-e159c1f4",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Function"
},
{
"digest": {
"line_hashes": [
"250170251853664210536720833369113176580",
"230066832946409072657591543494558915114",
"290759768303870081169497121878299897405",
"161679032901737729120383382741479273795"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/imx.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6a46719a2369eb5186d4f7e6c0478720ca1ec3d",
"id": "CVE-2025-38040-e86c75b5",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"224108331456808701928916655229542070656",
"182189094558861277547323014709386776021",
"323745342277923473060830857178084963816",
"157503560226742092608642800553096927410"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/8250/8250_port.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685",
"id": "CVE-2025-38040-e8db12ee",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"170272349796429275396221787674795244246",
"43702628474798734341324538715068883004",
"117687809362047600754745338712891761592",
"75224214039193016920997211362008924937"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/stm32-usart.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e6a46719a2369eb5186d4f7e6c0478720ca1ec3d",
"id": "CVE-2025-38040-ec58fab4",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"178446381786688826906386271424446438084",
"18305942805771504403457319077777334199",
"309451001227960315608818616669008550123",
"31552383670056053983232908188802325657"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/sh-sci.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c504c11b94d6e4ad818ca5578dffa8ff29ad0f20",
"id": "CVE-2025-38040-f78b85ff",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
},
{
"digest": {
"line_hashes": [
"250170251853664210536720833369113176580",
"230066832946409072657591543494558915114",
"290759768303870081169497121878299897405",
"161679032901737729120383382741479273795"
],
"threshold": 0.9
},
"target": {
"file": "drivers/tty/serial/imx.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1bd2aad57da95f7f2d2bb52f7ad15c0f4993a685",
"id": "CVE-2025-38040-fb333a12",
"signature_version": "v1",
"deprecated": false,
"signature_type": "Line"
}
]