CVE-2026-97477: RDMA/counter: Fix num_counters leak on bind_qp failure in alloc_and_bind()

Published Sep 24, 2026
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

RDMA/counter: Fix numcounters leak on bindqp failure in allocandbind()

When rdmacounterbindqp() fails in allocandbind(), the error path jumps to errmode which frees the counter without decrementing portcounter->numcounters. The only place that decrements is rdmacounterfree(), 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 countersetmode()) and blocking the MANUAL→NONE auto-revert in rdmacounterfree(). When the mode was NONE before the call, the MANUAL mode set by countersetmode() also leaks since the revert logic is never reached.

Add an errbind label between the numcounters increment and the existing errmode label. It decrements numcounters and mirrors the MANUAL→NONE revert from rdmacounterfree(), ensuring the port state is fully restored on bind failure.

Affected Software

1 affected component
Linux Linux kernel

Event History

Sep 24, 2026
CVE Published
via MITRE·04:04 PM
Data Sourced
via MITRE·04:04 PM
Description
Data Sourced
via NVD·05:17 PM
Description

Frequently Asked Questions

1

What conditions are needed to trigger the leak?

A call to alloc_and_bind() must reach the point where it increments port_counter->num_counters and then have __rdma_counter_bind_qp() fail. Repeated bind failures accumulate the leaked counter count.

2

What is the operational impact of repeated failures?

The port can become permanently unable to switch to AUTO mode because __counter_set_mode() returns -EBUSY. The MANUAL-to-NONE automatic revert in rdma_counter_free() can also be blocked.

3

Can a failed bind leave the port mode changed?

Yes. If the port was in NONE mode before the call, the MANUAL mode selected during the operation can remain set after a bind failure because the error path does not reach the revert logic.

4

What does the fix restore on a bind failure?

The corrected error path decrements port_counter->num_counters and applies the same MANUAL-to-NONE revert used by rdma_counter_free(). This restores the port counter state after the failed bind.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203