Skip to content
Heist/ feed
Back to feed
UnratedFix available

bpf: Keep refcount_acquire nullable for borrowed RCU kptrs

Type: advisorySources: OSV

In the Linux kernel, the following vulnerability has been resolved: bpf: Keep refcount_acquire nullable for borrowed RCU kptrs bpf_refcount_acquire() is fallible for a borrowed reference because the object may have reached a zero refcount. The verifier therefore keeps KF_RET_NULL on the return value unless the argument is an owning reference. An RCU-protected load of a local kptr is marked MEM_ALLOC, but it only receives NON_OWN_REF when the pointee contains a graph node. A refcounted object without a graph node consequently looks like an owning reference even though the loaded register has no acquired reference state. If the program drops the last real reference while remaining in the RCU critical section, refcount_inc_not_zero() returns NULL while the verifier treats the result as non-NULL. Only classify the argument as owning when it is backed by a verifier-tracked reference. This retains the non-NULL return for pointers from bpf_obj_new(), bpf_kptr_xchg(), or an earlier successful acquisition, while requiring a NULL check for borrowed RCU kptrs. [ kkd: Rewrote commit log ]

Products
Kernel
Affected versions
Not specified
Fixed versions
6.12.114, 6.18.57, 7.2.7
CVEs
CVE-2026-98038
Confirmed fixed CVEs
Not specified
Updated in this feed
7 Nov 2026, 21:16 UTC · Revision 1

Source evidence

bpf: Keep refcount_acquire nullable for borrowed RCU kptrs

core-osv · Original source

Published 25 Sept 2026, 10:23 UTC

In the Linux kernel, the following vulnerability has been resolved: bpf: Keep refcount_acquire nullable for borrowed RCU kptrs bpf_refcount_acquire() is fallible for a borrowed reference because the object may have reached a zero refcount. The verifier therefore keeps KF_RET_NULL on the return value unless the argument is an owning reference. An RCU-protected load of a local kptr is marked MEM_ALLOC, but it only receives NON_OWN_REF when the pointee contains a graph node. A refcounted object without a graph node consequently looks like an owning reference even though the loaded register has no acquired reference state. If the program drops the last real reference while remaining in the RCU critical section, refcount_inc_not_zero() returns NULL while the verifier treats the result as non-NULL. Only classify the argument as owning when it is backed by a verifier-tracked reference. This retains the non-NULL return for pointers from bpf_obj_new(), bpf_kptr_xchg(), or an earlier successful acquisition, while requiring a NULL check for borrowed RCU kptrs. [ kkd: Rewrote commit log ]

osv:CVE-2026-98038

Kernel

Fixed versions: 6.12.114, 6.18.57, 7.2.7

Complete source record
{
  "id": "bd1973ea1343e3b389eebeb99e5d294350c8b8db3b7fd2c7c0a8aa05f5f39ec8",
  "url": "https://osv.dev/vulnerability/CVE-2026-98038",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "bpf: Keep refcount_acquire nullable for borrowed RCU kptrs",
    "summary": "In the Linux kernel, the following vulnerability has been resolved: bpf: Keep refcount_acquire nullable for borrowed RCU kptrs bpf_refcount_acquire() is fallible for a borrowed reference because the object may have reached a zero refcount. The verifier therefore keeps KF_RET_NULL on the return value unless the argument is an owning reference. An RCU-protected load of a local kptr is marked MEM_ALLOC, but it only receives NON_OWN_REF when the pointee contains a graph node. A refcounted object without a graph node consequently looks like an owning reference even though the loaded register has no acquired reference state. If the program drops the last real reference while remaining in the RCU critical section, refcount_inc_not_zero() returns NULL while the verifier treats the result as non-NULL. Only classify the argument as owning when it is backed by a verifier-tracked reference. This retains the non-NULL return for pointers from bpf_obj_new(), bpf_kptr_xchg(), or an earlier successful acquisition, while requiring a NULL check for borrowed RCU kptrs. [ kkd: Rewrote commit log ]",
    "evidence": "osv:CVE-2026-98038",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "6.12.114",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "6.18.57",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "7.2.7",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2026-98038",
      "aliases": [
        "CVE-2026-98038"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "1b12171533a9bb23cf6fba7262b479028b65e1e8"
                },
                {
                  "fixed": "85bfc8b6db43502444c428eaa2de20bdd2fb9064"
                },
                {
                  "fixed": "8d19e2cdfba9ba8c8eb6a459cd666bec00a1d2c6"
                },
                {
                  "fixed": "85074498228a2500ea8b8039c49cc1ab8ad5328f"
                },
                {
                  "fixed": "dc36739e5cc9f60485418a910b42bc95339218d2"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-98038.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.8.0"
                },
                {
                  "fixed": "6.12.114"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.13.0"
                },
                {
                  "fixed": "6.18.57"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "6.19.0"
                },
                {
                  "fixed": "7.2.7"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-98038.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:51.595539831Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/85074498228a2500ea8b8039c49cc1ab8ad5328f",
        "https://git.kernel.org/stable/c/85bfc8b6db43502444c428eaa2de20bdd2fb9064",
        "https://git.kernel.org/stable/c/8d19e2cdfba9ba8c8eb6a459cd666bec00a1d2c6",
        "https://git.kernel.org/stable/c/dc36739e5cc9f60485418a910b42bc95339218d2",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/98xxx/CVE-2026-98038.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-98038",
        "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/98xxx/CVE-2026-98038.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-98038",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 520429,
  "published_at": "2026-09-25T10:23:51.746+00:00"
}