{"id":"AZL-117067","summary":"CVE-2026-139325 affecting package kernel 6.6.161.1-1","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.","modified":"2026-12-01T14:17:41.480422713Z","published":"2026-11-30T14:18:57Z","upstream":["CVE-2026-139325"],"references":[{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139325"}],"affected":[{"package":{"name":"kernel","ecosystem":"Azure Linux:3","purl":"pkg:rpm/azure-linux/kernel"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"6.6.161.1-1"}]}],"database_specific":{"source":"https://github.com/microsoft/AzureLinuxVulnerabilityData/blob/main/osv/AZL-117067.json"}}],"schema_version":"1.9.2"}