{"id":"CVE-2026-143057","summary":"gpio: shared: fix a race in shared desc release path","details":"In the Linux kernel, the following vulnerability has been resolved:\n\ngpio: shared: fix a race in shared desc release path\n\ngpiod_shared_put() races with concurrent calls to\ndevm_gpiod_shared_get() like so:\n\nCPU 0 (unbind / probe failure)      CPU 1 (concurrent proxy probe)\n==============================      ==============================\ngpiod_shared_put()\n  kref_put(&entry-\u003eref, ...)\n    refcount_dec_and_test() // -\u003e 0\n                                    devm_gpiod_shared_get()\n                                      mutex_lock(&entry-\u003elock);\n                                      if (entry-\u003eshared_desc) {\n                                        kref_get(&entry-\u003eref); // on 0!\n                                        shared_desc = entry-\u003eshared_desc;\n                                      }\n                                      mutex_unlock(&entry-\u003elock);\n    gpio_shared_release()\n      mutex_lock(&entry-\u003elock);\n      kfree(shared_desc);\n      entry-\u003eshared_desc = NULL;\n      mutex_unlock(&entry-\u003elock);\n                                      // uses freed shared_desc\n\nBecause gpiod_shared_put() decrements entry-\u003eref without holding\nentry-\u003elock and gpio_shared_release() only acquires entry-\u003elock after the\nreference count has already reached zero, a concurrent call to\ndevm_gpiod_shared_get() can acquire entry-\u003elock in the intermediate window\nand observe a non-NULL entry-\u003eshared_desc. This can result in a\nuse-after-free and a double-free when the second consumer releases its\nreference.\n\nUse kref_put_mutex() to ensure the entry lock is taken without a window\nin which a concurrent user can see a non-NULL entry-\u003eshared_desc while\nit's being released.","modified":"2026-12-03T11:01:06.677810467Z","published":"2026-12-03T09:18:34.769Z","database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143057.json"},"references":[{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"},{"type":"WEB","url":"https://git.kernel.org/stable/c/00ffca4b5fdd99f72b5811dc5f954f3f49aaae31"},{"type":"WEB","url":"https://git.kernel.org/stable/c/53043b9e83cc7f4e30e70161b67ae93c4c9fdb87"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/143xxx/CVE-2026-143057.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-143057"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"a060b8c511abb0997381b397e52149a5e3e5259a"},{"fixed":"00ffca4b5fdd99f72b5811dc5f954f3f49aaae31"},{"fixed":"53043b9e83cc7f4e30e70161b67ae93c4c9fdb87"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143057.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"6.19.0"},{"fixed":"7.3.7"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-143057.json"}}],"schema_version":"1.9.2"}