{"id":"CVE-2026-97477","state":"PUBLISHED","title":"RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind()\n\nWhen __rdma_counter_bind_qp() fails in alloc_and_bind(), the error path\njumps to err_mode which frees the counter without decrementing\nport_counter->num_counters. The only place that decrements is\nrdma_counter_free(), which is unreachable since the counter was never\nsuccessfully bound.\n\nThis leak accumulates across repeated failures, permanently preventing\nthe port from switching to AUTO mode (-EBUSY in __counter_set_mode())\nand blocking the MANUAL→NONE auto-revert in rdma_counter_free(). When\nthe mode was NONE before the call, the MANUAL mode set by\n__counter_set_mode() also leaks since the revert logic is never\nreached.\n\nAdd an err_bind label between the num_counters increment and the\nexisting err_mode label. It decrements num_counters and mirrors the\nMANUAL→NONE revert from rdma_counter_free(), ensuring the port state\nis fully restored on bind failure.","publishedAt":"2026-09-24T16:04:19.358Z","updatedAt":"2026-10-30T12:36:58.713Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"4517686789b404827591c52f79e9a57822371ca0","versionType":"git"},{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"7c9fee40fc8d8d928f44e99bc6e6adf93f9f2c2a","versionType":"git"},{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"1bcdeddddffadff9993657f6b0e5535d66ebd10f","versionType":"git"},{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"da95cb016812c0e012ea839f191926e35ca8f57f","versionType":"git"},{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"4fbc8230009f5b1bcd13cc74c5a6a43ddba141fd","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/core/counters.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.11","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.114","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.53","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/core/counters.c"]}],"references":["https://git.kernel.org/stable/c/4517686789b404827591c52f79e9a57822371ca0","https://git.kernel.org/stable/c/7c9fee40fc8d8d928f44e99bc6e6adf93f9f2c2a","https://git.kernel.org/stable/c/1bcdeddddffadff9993657f6b0e5535d66ebd10f","https://git.kernel.org/stable/c/da95cb016812c0e012ea839f191926e35ca8f57f","https://git.kernel.org/stable/c/4fbc8230009f5b1bcd13cc74c5a6a43ddba141fd"],"weaknesses":[],"ingestedAt":"2026-10-30T12:56:04.490Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/97xxx/CVE-2026-97477.json","commit":"1f312381e38164a43607eebab851b151dd16861e","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-97477","state":"PUBLISHED","datePublished":"2026-09-24T16:04:19.358Z","dateUpdated":"2026-10-30T12:36:58.713Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-09-24T16:01:01.149Z"},"containers":{"cna":{"title":"RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind()\n\nWhen __rdma_counter_bind_qp() fails in alloc_and_bind(), the error path\njumps to err_mode which frees the counter without decrementing\nport_counter->num_counters. The only place that decrements is\nrdma_counter_free(), which is unreachable since the counter was never\nsuccessfully bound.\n\nThis leak accumulates across repeated failures, permanently preventing\nthe port from switching to AUTO mode (-EBUSY in __counter_set_mode())\nand blocking the MANUAL→NONE auto-revert in rdma_counter_free(). When\nthe mode was NONE before the call, the MANUAL mode set by\n__counter_set_mode() also leaks since the revert logic is never\nreached.\n\nAdd an err_bind label between the num_counters increment and the\nexisting err_mode label. It decrements num_counters and mirrors the\nMANUAL→NONE revert from rdma_counter_free(), ensuring the port state\nis fully restored on bind failure."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"4517686789b404827591c52f79e9a57822371ca0","versionType":"git"},{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"7c9fee40fc8d8d928f44e99bc6e6adf93f9f2c2a","versionType":"git"},{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"1bcdeddddffadff9993657f6b0e5535d66ebd10f","versionType":"git"},{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"da95cb016812c0e012ea839f191926e35ca8f57f","versionType":"git"},{"version":"8bc205eff3056a9ed3850937cdd2192f05e6d3cb","status":"affected","lessThan":"4fbc8230009f5b1bcd13cc74c5a6a43ddba141fd","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/core/counters.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.11","status":"affected"},{"version":"0","status":"unaffected","lessThan":"5.11","versionType":"semver"},{"version":"6.1.191","status":"unaffected","lessThanOrEqual":"6.1.*","versionType":"semver"},{"version":"6.6.160","status":"unaffected","lessThanOrEqual":"6.6.*","versionType":"semver"},{"version":"6.12.114","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.53","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.2","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["drivers/infiniband/core/counters.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/4517686789b404827591c52f79e9a57822371ca0"},{"url":"https://git.kernel.org/stable/c/7c9fee40fc8d8d928f44e99bc6e6adf93f9f2c2a"},{"url":"https://git.kernel.org/stable/c/1bcdeddddffadff9993657f6b0e5535d66ebd10f"},{"url":"https://git.kernel.org/stable/c/da95cb016812c0e012ea839f191926e35ca8f57f"},{"url":"https://git.kernel.org/stable/c/4fbc8230009f5b1bcd13cc74c5a6a43ddba141fd"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-10-30T12:36:58.713Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.1.191"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.6.160"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.12.114"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"6.18.53"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"5.11","versionEndExcluding":"7.2"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}