{"id":"CVE-2026-143057","state":"PUBLISHED","title":"gpio: shared: fix a race in shared desc release path","description":"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->ref, ...)\n    refcount_dec_and_test() // -> 0\n                                    devm_gpiod_shared_get()\n                                      mutex_lock(&entry->lock);\n                                      if (entry->shared_desc) {\n                                        kref_get(&entry->ref); // on 0!\n                                        shared_desc = entry->shared_desc;\n                                      }\n                                      mutex_unlock(&entry->lock);\n    gpio_shared_release()\n      mutex_lock(&entry->lock);\n      kfree(shared_desc);\n      entry->shared_desc = NULL;\n      mutex_unlock(&entry->lock);\n                                      // uses freed shared_desc\n\nBecause gpiod_shared_put() decrements entry->ref without holding\nentry->lock and gpio_shared_release() only acquires entry->lock after the\nreference count has already reached zero, a concurrent call to\ndevm_gpiod_shared_get() can acquire entry->lock in the intermediate window\nand observe a non-NULL entry->shared_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->shared_desc while\nit's being released.","publishedAt":"2026-12-03T09:18:34.769Z","updatedAt":"2026-12-03T09:18:34.769Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"a060b8c511abb0997381b397e52149a5e3e5259a","status":"affected","lessThan":"00ffca4b5fdd99f72b5811dc5f954f3f49aaae31","versionType":"git"},{"version":"a060b8c511abb0997381b397e52149a5e3e5259a","status":"affected","lessThan":"53043b9e83cc7f4e30e70161b67ae93c4c9fdb87","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpio/gpiolib-shared.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.19","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpio/gpiolib-shared.c"]}],"references":["https://git.kernel.org/stable/c/00ffca4b5fdd99f72b5811dc5f954f3f49aaae31","https://git.kernel.org/stable/c/53043b9e83cc7f4e30e70161b67ae93c4c9fdb87"],"weaknesses":[],"ingestedAt":"2026-12-03T09:28:04.553Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143057.json","commit":"9fd484e43f2e14021809e195d28c1172759faad0","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143057","state":"PUBLISHED","datePublished":"2026-12-03T09:18:34.769Z","dateUpdated":"2026-12-03T09:18:34.769Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.345Z"},"containers":{"cna":{"title":"gpio: shared: fix a race in shared desc release path","descriptions":[{"lang":"en","value":"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->ref, ...)\n    refcount_dec_and_test() // -> 0\n                                    devm_gpiod_shared_get()\n                                      mutex_lock(&entry->lock);\n                                      if (entry->shared_desc) {\n                                        kref_get(&entry->ref); // on 0!\n                                        shared_desc = entry->shared_desc;\n                                      }\n                                      mutex_unlock(&entry->lock);\n    gpio_shared_release()\n      mutex_lock(&entry->lock);\n      kfree(shared_desc);\n      entry->shared_desc = NULL;\n      mutex_unlock(&entry->lock);\n                                      // uses freed shared_desc\n\nBecause gpiod_shared_put() decrements entry->ref without holding\nentry->lock and gpio_shared_release() only acquires entry->lock after the\nreference count has already reached zero, a concurrent call to\ndevm_gpiod_shared_get() can acquire entry->lock in the intermediate window\nand observe a non-NULL entry->shared_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->shared_desc while\nit's being released."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"a060b8c511abb0997381b397e52149a5e3e5259a","status":"affected","lessThan":"00ffca4b5fdd99f72b5811dc5f954f3f49aaae31","versionType":"git"},{"version":"a060b8c511abb0997381b397e52149a5e3e5259a","status":"affected","lessThan":"53043b9e83cc7f4e30e70161b67ae93c4c9fdb87","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpio/gpiolib-shared.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.19","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.19","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/gpio/gpiolib-shared.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/00ffca4b5fdd99f72b5811dc5f954f3f49aaae31"},{"url":"https://git.kernel.org/stable/c/53043b9e83cc7f4e30e70161b67ae93c4c9fdb87"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:18:34.769Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.19","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.19","versionEndExcluding":"7.4-rc3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}