{
  "affected": [
    {
      "ranges": [
        {
          "events": [
            {
              "introduced": "314ee05e2fc601a7bece14376547d2b7a04bab67"
            },
            {
              "fixed": "b13b93f264ec9a700e22f91ada8313acc44ada2a"
            },
            {
              "fixed": "9bdd5e7f5d8313fa1f3a210621b4007bb5ad0ec6"
            }
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "type": "GIT"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "Linux",
        "name": "Kernel"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "5.13.0"
            },
            {
              "fixed": "7.3.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139325.json"
  },
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nbpf: Forbid sleeping in hash map for_each callbacks\n\nA sleepable program (e.g. SEC(\"syscall\"), lsm.s, fentry.s) can pass a\ncallback to bpf_for_each_map_elem() on a hash map and call a sleepable\nhelper or kfunc such as bpf_copy_from_user() from it. The verifier\naccepts this, but at run time the callback is invoked from inside an RCU\nread-side critical section:\n\n    bpf_for_each_hash_elem()\n      rcu_read_lock();\n      callback_fn(map, key, val, ctx, 0);\n        bpf_copy_from_user()       \u003c- may fault and sleep\n      rcu_read_unlock();\n\nbpf_each_rhash_elem() does the same for BPF_MAP_TYPE_RHASH. Sleeping\nthere triggers the \"Voluntary context switch within RCU read-side\ncritical section!\" warning, delays grace periods, and with\nCONFIG_PREEMPT_RCU=n silently ends the read-side critical section that\nthe bucket walk relies on.\n\nSynchronous callbacks are verified with the caller's state, so\nkernel/bpf/verifier.c:in_sleepable_context() only looks at the program's\nsleepability and the locks the program took itself, and does not know\nthat the helper holds rcu_read_lock() around the callback.\n\nWith a SEC(\"syscall\") program whose callback reads a page that has to be\nread from disk first:\n\n  BUG: sleeping function called from invalid context at include/linux/uaccess.h:169\n  RCU nest depth: 1, expected: 0\n   __might_fault+0x29/0x80\n   _copy_from_user+0x26/0x90\n   bpf_copy_from_user+0x23/0x60\n   bpf_prog_17d44fa39eebd6cc_cb+0x35/0x46\n   bpf_for_each_hash_elem+0xdb/0x280\n\nFix by marking the callback frame of hash map iteration as running under\nRCU and making in_sleepable_context() false while such a frame is on the\ncall stack, so sleepable helpers, kfuncs and global functions are\nrejected there as inside bpf_rcu_read_lock(). The rules for trusting RCU\nprotected pointers are left alone, which is conservative and keeps\ncallbacks that verify today and do not sleep working. The flag is\ncompared in func_states_equal() so that pruning never mixes the two\ncontexts. Array map callbacks run without any lock and keep the caller's\ncontext.",
  "id": "CVE-2026-139325",
  "modified": "2026-12-01T20:45:44.652197955Z",
  "published": "2026-11-30T13:33:43.168Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/9bdd5e7f5d8313fa1f3a210621b4007bb5ad0ec6"
    },
    {
      "type": "WEB",
      "url": "https://git.kernel.org/stable/c/b13b93f264ec9a700e22f91ada8313acc44ada2a"
    },
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/139xxx/CVE-2026-139325.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-139325"
    },
    {
      "type": "PACKAGE",
      "url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
    }
  ],
  "schema_version": "1.9.2",
  "summary": "bpf: Forbid sleeping in hash map for_each callbacks"
}