{"id":"CVE-2026-139664","aliases":["CVE-2026-139664"],"related":[],"kind":"vulnerability","state":"published","title":"RDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT\n\nThe UVERBS_METHOD_GET_CONTEXT handler allocates the ucontext via\nib_alloc_ucontext(), which calls rdma_restrack_new() (initialising the\nkref to 1) and rdma_restrack_set_name(NULL), the latter attaching the\ncurrent task and taking a task_struct reference.  When ib_init_ucontext()\nsubsequently fails, the error path only does:\n\n\tkfree(attrs->context);\n\tattrs->context = NULL;\n\nwithout first calling rdma_restrack_put() on &attrs->context->res.  The\nkref therefore never reaches zero, restrack_release() is never invoked,\nand put_task_struct() is never called, so the task_struct reference taken\nduring set_name is leaked permanently.\n\nA local user with access to an RDMA device can repeat this path (e.g. by\nhitting an RDMA cgroup limit or supplying invalid ucaps) and leak one\ntask_struct reference per attempt, eventually preventing those processes\nfrom being reaped or exhausting memory.\n\nThe legacy ib_uverbs_get_context() path already handles this correctly\nat its err_ucontext label, where rdma_restrack_put() precedes kfree().\nMirror that ordering here.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nRDMA/uverbs: Drop restrack ref on ib_init_ucontext() failure in GET_CONTEXT\n\nThe UVERBS_METHOD_GET_CONTEXT handler allocates the ucontext via\nib_alloc_ucontext(), which calls rdma_restrack_new() (initialising the\nkref to 1) and rdma_restrack_set_name(NULL), the latter attaching the\ncurrent task and taking a task_struct reference.  When ib_init_ucontext()\nsubsequently fails, the error path only does:\n\n\tkfree(attrs->context);\n\tattrs->context = NULL;\n\nwithout first calling rdma_restrack_put() on &attrs->context->res.  The\nkref therefore never reaches zero, restrack_release() is never invoked,\nand put_task_struct() is never called, so the task_struct reference taken\nduring set_name is leaked permanently.\n\nA local user with access to an RDMA device can repeat this path (e.g. by\nhitting an RDMA cgroup limit or supplying invalid ucaps) and leak one\ntask_struct reference per attempt, eventually preventing those processes\nfrom being reaped or exhausting memory.\n\nThe legacy ib_uverbs_get_context() path already handles this correctly\nat its err_ucontext label, where rdma_restrack_put() precedes kfree().\nMirror that ordering here.","source":"cvelist"}],"published":"2026-11-30T13:36:50.627Z","modified":"2026-11-30T14:19:50.737Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"a1123418ba1078037d9fecb72573ff7222dfe201","fixed":"e845dc5fa35d90c28861c6a21063f7c73360af75","status":"affected"},{"type":"git","introduced":"a1123418ba1078037d9fecb72573ff7222dfe201","fixed":"7f0bac5c52cb3a31a674ca61c25cd0be2151a05d","status":"affected"},{"type":"git","introduced":"a1123418ba1078037d9fecb72573ff7222dfe201","fixed":"c50f84dd10f2b6a0d8fa203b08a48d4bb333a07f","status":"affected"},{"type":"git","introduced":"a1123418ba1078037d9fecb72573ff7222dfe201","fixed":"7b0cbff7c7e12586dbd55a8ac6a1133da0b7979d","status":"affected"},{"type":"git","introduced":"a1123418ba1078037d9fecb72573ff7222dfe201","fixed":"d1946ab6dbc31ac4fd87123c337fbabe4da539ef","status":"affected"},{"type":"git","introduced":"a1123418ba1078037d9fecb72573ff7222dfe201","fixed":"e47ea092ab3cc9f0074f141f749165c86de42171","status":"affected"},{"type":"git","introduced":"a1123418ba1078037d9fecb72573ff7222dfe201","fixed":"02e31eea7c929384b5efe2e80fa22fb42601724a","status":"affected"},{"type":"git","introduced":"a1123418ba1078037d9fecb72573ff7222dfe201","fixed":"9dcacdc41083cccff74292851bf9fde999e0731a","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.6","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.6","status":"unaffected"},{"type":"semver","introduced":"5.10.275","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.226","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.193","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.163","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.119","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.18.65","lastAffected":"6.18.*","status":"unaffected"},{"type":"semver","introduced":"7.3.6","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/e845dc5fa35d90c28861c6a21063f7c73360af75","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7f0bac5c52cb3a31a674ca61c25cd0be2151a05d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c50f84dd10f2b6a0d8fa203b08a48d4bb333a07f","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7b0cbff7c7e12586dbd55a8ac6a1133da0b7979d","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d1946ab6dbc31ac4fd87123c337fbabe4da539ef","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/e47ea092ab3cc9f0074f141f749165c86de42171","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/02e31eea7c929384b5efe2e80fa22fb42601724a","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/9dcacdc41083cccff74292851bf9fde999e0731a","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139664","url":"https://www.cve.org/CVERecord?id=CVE-2026-139664","licence":"CVE Terms of Use","modified":"2026-11-30T13:36:50.627Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139664","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139664","licence":"Public domain","modified":"2026-11-30T14:19:50.737Z"}],"updatedAt":"2026-11-30T14:33:10.587Z","epss":{"score":0.00176,"percentile":0.07451,"date":"2026-12-01T12:00:22.000Z"}}