{"id":"CVE-2026-139166","state":"PUBLISHED","title":"devlink: region: fix snapshot id leak on kernel-allocated ids","description":"In the Linux kernel, the following vulnerability has been resolved:\n\ndevlink: region: fix snapshot id leak on kernel-allocated ids\n\nWhen DEVLINK_CMD_REGION_NEW is issued without a snapshot id, the kernel\nallocates one with __devlink_region_snapshot_id_get(). That helper counts\nthe caller as a user of the id, and the caller must release this hold\nonce it is done.\n\ndevlink_nl_region_new_doit() never drops it. The refcount of the id goes\n1 (allocation) -> 2 (snapshot created) and stays at 2. When the snapshot\nis deleted the count only drops to 1, so the id is never erased from\nthe snapshot_ids xarray. The id then stays in use for the lifetime of\nthe devlink instance: requesting a snapshot with that explicit id fails\nwith -EEXIST, and there is no snapshot left to delete to clean it up.\n\nReproducer steps:\n  # devlink region new pci/0000:13:00.0/device-caps\n  pci/0000:13:00.0/device-caps: snapshot 0\n  # devlink region del pci/0000:13:00.0/device-caps snapshot 0\n  # devlink region new pci/0000:13:00.0/device-caps snapshot 0\n  kernel answers: File exists\n\nDrop the caller's reference right after the snapshot has been created,\nas the snapshot then holds its own.","publishedAt":"2026-11-30T13:32:11.572Z","updatedAt":"2026-11-30T13:32:11.572Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"242d67e369ec055480eabe893f61b5a94c316aed","versionType":"git"},{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"5c6be0c090fc6f5d88aef30447c2abdbbb9a8e2b","versionType":"git"},{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"33393bd60015355eba67f96ef084a7e1a0e03a5f","versionType":"git"},{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"5ecaa25ea1fc4b5df73ac019915e7785c7df50c3","versionType":"git"},{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"ef8f0a1d888e0280452792f6d4edad237c934a51","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/devlink/region.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/devlink/region.c"]}],"references":["https://git.kernel.org/stable/c/242d67e369ec055480eabe893f61b5a94c316aed","https://git.kernel.org/stable/c/5c6be0c090fc6f5d88aef30447c2abdbbb9a8e2b","https://git.kernel.org/stable/c/33393bd60015355eba67f96ef084a7e1a0e03a5f","https://git.kernel.org/stable/c/5ecaa25ea1fc4b5df73ac019915e7785c7df50c3","https://git.kernel.org/stable/c/ef8f0a1d888e0280452792f6d4edad237c934a51"],"weaknesses":[],"ingestedAt":"2026-11-30T13:44:05.999Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/139xxx/CVE-2026-139166.json","commit":"8c2c22940a0de21d18737df980299c0488d5dc73","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-139166","state":"PUBLISHED","datePublished":"2026-11-30T13:32:11.572Z","dateUpdated":"2026-11-30T13:32:11.572Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-11-30T13:22:15.918Z"},"containers":{"cna":{"title":"devlink: region: fix snapshot id leak on kernel-allocated ids","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\ndevlink: region: fix snapshot id leak on kernel-allocated ids\n\nWhen DEVLINK_CMD_REGION_NEW is issued without a snapshot id, the kernel\nallocates one with __devlink_region_snapshot_id_get(). That helper counts\nthe caller as a user of the id, and the caller must release this hold\nonce it is done.\n\ndevlink_nl_region_new_doit() never drops it. The refcount of the id goes\n1 (allocation) -> 2 (snapshot created) and stays at 2. When the snapshot\nis deleted the count only drops to 1, so the id is never erased from\nthe snapshot_ids xarray. The id then stays in use for the lifetime of\nthe devlink instance: requesting a snapshot with that explicit id fails\nwith -EEXIST, and there is no snapshot left to delete to clean it up.\n\nReproducer steps:\n  # devlink region new pci/0000:13:00.0/device-caps\n  pci/0000:13:00.0/device-caps: snapshot 0\n  # devlink region del pci/0000:13:00.0/device-caps snapshot 0\n  # devlink region new pci/0000:13:00.0/device-caps snapshot 0\n  kernel answers: File exists\n\nDrop the caller's reference right after the snapshot has been created,\nas the snapshot then holds its own."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"242d67e369ec055480eabe893f61b5a94c316aed","versionType":"git"},{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"5c6be0c090fc6f5d88aef30447c2abdbbb9a8e2b","versionType":"git"},{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"33393bd60015355eba67f96ef084a7e1a0e03a5f","versionType":"git"},{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"5ecaa25ea1fc4b5df73ac019915e7785c7df50c3","versionType":"git"},{"version":"043b3e22768d5d909cb1474fc21ae2fbaf026c0c","status":"affected","lessThan":"ef8f0a1d888e0280452792f6d4edad237c934a51","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/devlink/region.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.8","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.8","versionType":"semver"},{"version":"6.6.163","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.119","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.65","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.6","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc1","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/devlink/region.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/242d67e369ec055480eabe893f61b5a94c316aed"},{"url":"https://git.kernel.org/stable/c/5c6be0c090fc6f5d88aef30447c2abdbbb9a8e2b"},{"url":"https://git.kernel.org/stable/c/33393bd60015355eba67f96ef084a7e1a0e03a5f"},{"url":"https://git.kernel.org/stable/c/5ecaa25ea1fc4b5df73ac019915e7785c7df50c3"},{"url":"https://git.kernel.org/stable/c/ef8f0a1d888e0280452792f6d4edad237c934a51"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-11-30T13:32:11.572Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.6.163"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.12.119"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"6.18.65"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"7.3.6"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.8","versionEndExcluding":"7.4-rc1"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}