CVE-2026-139664

RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT

The UVERBS_METHOD_GET_CONTEXT handler allocates the ucontext via
ib_alloc_ucontext(), which calls rdma_restrack_new() (initialising the
kref to 1) and rdma_restrack_set_name(NULL), the latter attaching the
current task and taking a task_struct reference. When ib_init_ucontext()
subsequently fails, the error path only does:

kfree(attrs->context);
attrs->context = NULL;

without first calling rdma_restrack_put() on &attrs->context->res. The
kref therefore never reaches zero, restrack_release() is never invoked,
and put_task_struct() is never called, so the task_struct reference taken
during set_name is leaked permanently.

A local user with access to an RDMA device can repeat this path (e.g. by
hitting an RDMA cgroup limit or supplying invalid ucaps) and leak one
task_struct reference per attempt, eventually preventing those processes
from being reaped or exhausting memory.

The legacy ib_uverbs_get_context() path already handles this correctly
at its err_ucontext label, where rdma_restrack_put() precedes kfree().
Mirror that ordering here.

Analysis

AI-generated

Technical impact

In the Linux kernel RDMA uverbs implementation, the failure path of ib_init_ucontext() fails to release a reference to a task_struct that was acquired during rdma_restrack_set_name(). This causes a persistent memory leak of the task_struct reference, allowing a local user with RDMA device access to increment the leak with each failed request. Over time the kernel can exhaust memory or prevent processes from being reaped, resulting in denial of service.

Affected Systems

All Linux kernel builds that include the RDMA uverbs subsystem are affected. The CVE references and CPE string indicate the vulnerability applies broadly to the Linux kernel across all versions where this code path exists; no specific kernel versions are enumerated.

Risk and Exploitability

The exploit requires local user privilege with access to an RDMA device, no network or elevated permissions are necessary. The EPSS score is not available, and the vulnerability is not listed in the CISA KEV catalog. The potential impact is a denial of service through memory exhaustion or process stagnation, triggered repeatedly by hitting cgroup limits or supplying invalid capabilities. Attackers can exploit the flaw repeatedly to consume kernel memory until a reboot or intervention occurs.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the latest kernel update that incorporates the fix for RDMA uverbs GET_CONTEXT.
  • Restrict RDMA device permissions so that only trusted users or services can access them; adjust udev rules or mount options to enforce this.
  • Configure RDMA-related cgroup limits to prevent abuse by a single user from saturating resources.
  • Continuously monitor kernel memory usage and task_struct counts; reboot or remove the RDMA device from the system if abnormal growth is observed.

Generated by OpenCVE AI on December 1, 2026 at 00:27 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-401
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT The UVERBS_METHOD_GET_CONTEXT handler allocates the ucontext via ib_alloc_ucontext(), which calls rdma_restrack_new() (initialising the kref to 1) and rdma_restrack_set_name(NULL), the latter attaching the current task and taking a task_struct reference. When ib_init_ucontext() subsequently fails, the error path only does: kfree(attrs->context); attrs->context = NULL; without first calling rdma_restrack_put() on &attrs->context->res. The kref therefore never reaches zero, restrack_release() is never invoked, and put_task_struct() is never called, so the task_struct reference taken during set_name is leaked permanently. A local user with access to an RDMA device can repeat this path (e.g. by hitting an RDMA cgroup limit or supplying invalid ucaps) and leak one task_struct reference per attempt, eventually preventing those processes from being reaped or exhausting memory. The legacy ib_uverbs_get_context() path already handles this correctly at its err_ucontext label, where rdma_restrack_put() precedes kfree(). Mirror that ordering here.
Title RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-401

    Missing Release of Memory after Effective Lifetime

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:36 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:19 PM
Modified
Nov 30, 2026, 2:19 PM