{"id":"CVE-2025-38632","aliases":["CVE-2025-38632"],"related":[],"kind":"vulnerability","state":"published","title":"pinmux: fix race causing mux_owner NULL with active mux_usecount","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\npinmux: fix race causing mux_owner NULL with active mux_usecount\n\ncommit 5a3e85c3c397 (\"pinmux: Use sequential access to access\ndesc->pinmux data\") tried to address the issue when two client of the\nsame gpio calls pinctrl_select_state() for the same functionality, was\nresulting in NULL pointer issue while accessing desc->mux_owner.\nHowever, issue was not completely fixed due to the way it was handled\nand it can still result in the same NULL pointer.\n\nThe issue occurs due to the following interleaving:\n\n     cpu0 (process A)                   cpu1 (process B)\n\n      pin_request() {                   pin_free() {\n\n                                         mutex_lock()\n                                         desc->mux_usecount--; //becomes 0\n                                         ..\n                                         mutex_unlock()\n\n  mutex_lock(desc->mux)\n  desc->mux_usecount++; // becomes 1\n  desc->mux_owner = owner;\n  mutex_unlock(desc->mux)\n\n                                         mutex_lock(desc->mux)\n                                         desc->mux_owner = NULL;\n                                         mutex_unlock(desc->mux)\n\nThis sequence leads to a state where the pin appears to be in use\n(`mux_usecount == 1`) but has no owner (`mux_owner == NULL`), which can\ncause NULL pointer on next pin_request on the same pin.\n\nEnsure that updates to mux_usecount and mux_owner are performed\natomically under the same lock. Only clear mux_owner when mux_usecount\nreaches zero and no new owner has been assigned.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\npinmux: fix race causing mux_owner NULL with active mux_usecount\n\ncommit 5a3e85c3c397 (\"pinmux: Use sequential access to access\ndesc->pinmux data\") tried to address the issue when two client of the\nsame gpio calls pinctrl_select_state() for the same functionality, was\nresulting in NULL pointer issue while accessing desc->mux_owner.\nHowever, issue was not completely fixed due to the way it was handled\nand it can still result in the same NULL pointer.\n\nThe issue occurs due to the following interleaving:\n\n     cpu0 (process A)                   cpu1 (process B)\n\n      pin_request() {                   pin_free() {\n\n                                         mutex_lock()\n                                         desc->mux_usecount--; //becomes 0\n                                         ..\n                                         mutex_unlock()\n\n  mutex_lock(desc->mux)\n  desc->mux_usecount++; // becomes 1\n  desc->mux_owner = owner;\n  mutex_unlock(desc->mux)\n\n                                         mutex_lock(desc->mux)\n                                         desc->mux_owner = NULL;\n                                         mutex_unlock(desc->mux)\n\nThis sequence leads to a state where the pin appears to be in use\n(`mux_usecount == 1`) but has no owner (`mux_owner == NULL`), which can\ncause NULL pointer on next pin_request on the same pin.\n\nEnsure that updates to mux_usecount and mux_owner are performed\natomically under the same lock. Only clear mux_owner when mux_usecount\nreaches zero and no new owner has been assigned.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: pinmux: corrección de la carrera que causaba que mux_owner fuera nulo con el commit 5a3e85c3c397 de mux_usecount activa (\"pinmux: Usar acceso secuencial para acceder a los datos de desc-&gt;pinmux\"). Se intentó solucionar el problema cuando dos clientes del mismo GPIO llamaban a pinctrl_select_state() para la misma funcionalidad, lo que provocaba un problema de puntero nulo al acceder a desc-&gt;mux_owner. Sin embargo, el problema no se solucionó por completo debido a la forma en que se gestionó y aún puede resultar en el mismo puntero nulo. El problema se produce debido a la siguiente intercalación: cpu0 (proceso A) cpu1 (proceso B) pin_request() { pin_free() { mutex_lock() desc-&gt;mux_usecount--; //se convierte en 0 .. mutex_unlock() mutex_lock(desc-&gt;mux) desc-&gt;mux_usecount++; // se convierte en 1 desc-&gt;mux_owner = owner; mutex_unlock(desc-&gt;mux) mutex_lock(desc-&gt;mux) desc-&gt;mux_owner = NULL; mutex_unlock(desc-&gt;mux) Esta secuencia lleva a un estado donde el pin parece estar en uso (`mux_usecount == 1`) pero no tiene propietario (`mux_owner == NULL`), lo que puede generar un puntero nulo en la siguiente solicitud de pin en el mismo pin. Asegúrese de que las actualizaciones de mux_usecount y mux_owner se realicen automáticamente bajo el mismo bloqueo. Solo borre mux_owner cuando mux_usecount llegue a cero y no se haya asignado un nuevo propietario.","source":"nvd"}],"published":"2025-08-22T16:00:40.423Z","modified":"2026-11-05T22:17:21.570Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","score":4.7,"rating":"MEDIUM"}],"cwes":["CWE-362","CWE-476"],"affected":[{"ranges":[{"type":"git","introduced":"d25e45dcf8e32062f7935e4ba154869043812ab6","fixed":"8434dec94e73cad527341d6280895191d949a702","status":"affected"},{"type":"git","introduced":"2da32aed4a97ca1d70fb8b77926f72f30ce5fb4b","fixed":"9b2a3e7189028aa7c4d53a84364f2ea9fb209787","status":"affected"},{"type":"git","introduced":"c11e2ec9a780f54982a187ee10ffd1b810715c85","fixed":"9ea3f6b9a67be3476e331ce51cac316c2614a564","status":"affected"},{"type":"git","introduced":"5a3e85c3c397c781393ea5fb2f45b1f60f8a4e6e","fixed":"b7bd6e3971eb7f0e34d2fdce1b18b08094e0c804","status":"affected"},{"type":"git","introduced":"5a3e85c3c397c781393ea5fb2f45b1f60f8a4e6e","fixed":"22b585cbd67d14df3b91529d1b990661c300faa9","status":"affected"},{"type":"git","introduced":"5a3e85c3c397c781393ea5fb2f45b1f60f8a4e6e","fixed":"0b075c011032f88d1cfde3b45d6dcf08b44140eb","status":"affected"},{"type":"semver","introduced":"6.6.66","fixed":"6.6.102","status":"affected"},{"type":"semver","introduced":"6.12.5","fixed":"6.12.42","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"6.13","status":"affected"},{"type":"semver","introduced":"0","fixed":"6.13","status":"unaffected"},{"type":"semver","introduced":"6.6.102","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.42","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.15.10","lastAffected":"6.15.*","status":"unaffected"},{"type":"semver","introduced":"6.16.1","lastAffected":"6.16.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.17","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"6.6.66","fixed":"6.6.102"},{"status":"affected","introduced":"6.12.5","fixed":"6.12.42"},{"status":"affected","introduced":"6.13","fixed":"6.15.10"},{"status":"affected","introduced":"6.16","fixed":"6.16.1"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/8434dec94e73cad527341d6280895191d949a702","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9b2a3e7189028aa7c4d53a84364f2ea9fb209787","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9ea3f6b9a67be3476e331ce51cac316c2614a564","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/b7bd6e3971eb7f0e34d2fdce1b18b08094e0c804","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/22b585cbd67d14df3b91529d1b990661c300faa9","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0b075c011032f88d1cfde3b45d6dcf08b44140eb","tags":["patch"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T21:05:29.790Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-38632","url":"https://www.cve.org/CVERecord?id=CVE-2025-38632","licence":"CVE Terms of Use","modified":"2026-11-05T21:12:49.802Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-38632","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38632","licence":"Public domain","modified":"2026-11-05T22:17:21.570Z"}],"updatedAt":"2026-11-25T22:59:03.531Z","epss":{"score":0.00175,"percentile":0.0413,"date":"2026-11-30T12:00:22.000Z"}}