Skip to content
Heist/ feed
Back to feed
UnratedFix available

RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind()

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind() When __rdma_counter_bind_qp() fails in alloc_and_bind(), the error path jumps to err_mode which frees the counter without decrementing port_counter->num_counters. The only place that decrements is rdma_counter_free(), which is unreachable since the counter was never successfully bound. This leak accumulates across repeated failures, permanently preventing the port from switching to AUTO mode (-EBUSY in __counter_set_mode()) and blocking the MANUAL→NONE auto-revert in rdma_counter_free(). When the mode was NONE before the call, the MANUAL mode set by __counter_set_mode() also leaks since the revert logic is never reached. Add an err_bind label between the num_counters increment and the existing err_mode label. It decrements num_counters and mirrors the MANUAL→NONE revert from rdma_counter_free(), ensuring the port state is fully restored on bind failure.

Products
Kernel
Affected versions
Not specified
Fixed versions
6.1.191, 6.12.114, 6.18.53, 6.6.160
CVEs
CVE-2026-97477
Confirmed fixed CVEs
Not specified
Updated in this feed
3 Nov 2026, 02:59 UTC · Revision 1

Source evidence

RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind()

core-osv · Original source

Published 24 Sept 2026, 16:04 UTC

In the Linux kernel, the following vulnerability has been resolved: RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind() When __rdma_counter_bind_qp() fails in alloc_and_bind(), the error path jumps to err_mode which frees the counter without decrementing port_counter->num_counters. The only place that decrements is rdma_counter_free(), which is unreachable since the counter was never successfully bound. This leak accumulates across repeated failures, permanently preventing the port from switching to AUTO mode (-EBUSY in __counter_set_mode()) and blocking the MANUAL→NONE auto-revert in rdma_counter_free(). When the mode was NONE before the call, the MANUAL mode set by __counter_set_mode() also leaks since the revert logic is never reached. Add an err_bind label between the num_counters increment and the existing err_mode label. It decrements num_counters and mirrors the MANUAL→NONE revert from rdma_counter_free(), ensuring the port state is fully restored on bind failure.

osv:CVE-2026-97477

Kernel

Fixed versions: 6.1.191, 6.6.160, 6.12.114, 6.18.53

Complete source record
{
  "id": "a245e6e6aa888790495619d57c9e6b9187ae524401d42f67e921372abde8fe05",
  "url": "https://osv.dev/vulnerability/CVE-2026-97477",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind()",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind() When __rdma_counter_bind_qp() fails in alloc_and_bind(), the error path jumps to err_mode which frees the counter without decrementing port_counter->num_counters. The only place that decrements is rdma_counter_free(), which is unreachable since the counter was never successfully bound. This leak accumulates across repeated failures, permanently preventing the port from switching to AUTO mode (-EBUSY in __counter_set_mode()) and blocking the MANUAL→NONE auto-revert in rdma_counter_free(). When the mode was NONE before the call, the MANUAL mode set by __counter_set_mode() also leaks since the revert logic is never reached. Add an err_bind label between the num_counters increment and the existing err_mode label. It decrements num_counters and mirrors the MANUAL→NONE revert from rdma_counter_free(), ensuring the port state is fully restored on bind failure.",
    "evidence": "osv:CVE-2026-97477",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.1.191",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.6.160",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.12.114",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.18.53",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2026-97477",
      "aliases": [
        "CVE-2026-97477"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "8bc205eff3056a9ed3850937cdd2192f05e6d3cb"
                },
                {
                  "fixed": "4517686789b404827591c52f79e9a57822371ca0"
                },
                {
                  "fixed": "7c9fee40fc8d8d928f44e99bc6e6adf93f9f2c2a"
                },
                {
                  "fixed": "1bcdeddddffadff9993657f6b0e5535d66ebd10f"
                },
                {
                  "fixed": "da95cb016812c0e012ea839f191926e35ca8f57f"
                },
                {
                  "fixed": "4fbc8230009f5b1bcd13cc74c5a6a43ddba141fd"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-97477.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "6.1.191"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.2.0"
                },
                {
                  "fixed": "6.6.160"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.7.0"
                },
                {
                  "fixed": "6.12.114"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.18.53"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-97477.json"
          }
        }
      ],
      "modified": "2026-11-01T02:30:54.819236660Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/1bcdeddddffadff9993657f6b0e5535d66ebd10f",
        "https://git.kernel.org/stable/c/4517686789b404827591c52f79e9a57822371ca0",
        "https://git.kernel.org/stable/c/4fbc8230009f5b1bcd13cc74c5a6a43ddba141fd",
        "https://git.kernel.org/stable/c/7c9fee40fc8d8d928f44e99bc6e6adf93f9f2c2a",
        "https://git.kernel.org/stable/c/da95cb016812c0e012ea839f191926e35ca8f57f",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/97xxx/CVE-2026-97477.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-97477",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/97xxx/CVE-2026-97477.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-97477",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 492093,
  "published_at": "2026-09-24T16:04:19.358+00:00"
}