{"id":"CVE-2026-139661","aliases":["CVE-2026-139661"],"related":[],"kind":"vulnerability","state":"published","title":"bpf, lsm: Reject writes into the BPF LSM program context","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, lsm: Reject writes into the BPF LSM program context\n\nThe verifier types a load from a tracing-style context by its offset\nalone: btf_ctx_access() looks the offset up in the attach hook's\nprototype, and check_mem_access() stamps the resulting type onto the\ndestination register. Nothing tracks what the slot actually holds.\nThat is sound only as long as the context is read-only, and for BPF LSM\nit is not. lsm_verifier_ops wires ->is_valid_access() straight to\nbtf_ctx_access(), which never looks at enum bpf_access_type, so a store\ninto the context passes verification. Every other user of the helper\neither goes through bpf_tracing_btf_ctx_access() or open-codes the same\ntype != BPF_READ test first; BPF LSM is the only one that does neither.\n\nA program can therefore store a scalar of its choosing into a context\nslot, read the slot back, and get a register the verifier believes is a\ntrusted pointer of the hook's argument type. Handing that to a kfunc or\nhelper which dereferences a trusted argument turns it into an arbitrary\nkernel access. Route BPF LSM through bpf_tracing_btf_ctx_access() like\neveryone else.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nbpf, lsm: Reject writes into the BPF LSM program context\n\nThe verifier types a load from a tracing-style context by its offset\nalone: btf_ctx_access() looks the offset up in the attach hook's\nprototype, and check_mem_access() stamps the resulting type onto the\ndestination register. Nothing tracks what the slot actually holds.\nThat is sound only as long as the context is read-only, and for BPF LSM\nit is not. lsm_verifier_ops wires ->is_valid_access() straight to\nbtf_ctx_access(), which never looks at enum bpf_access_type, so a store\ninto the context passes verification. Every other user of the helper\neither goes through bpf_tracing_btf_ctx_access() or open-codes the same\ntype != BPF_READ test first; BPF LSM is the only one that does neither.\n\nA program can therefore store a scalar of its choosing into a context\nslot, read the slot back, and get a register the verifier believes is a\ntrusted pointer of the hook's argument type. Handing that to a kfunc or\nhelper which dereferences a trusted argument turns it into an arbitrary\nkernel access. Route BPF LSM through bpf_tracing_btf_ctx_access() like\neveryone else.","source":"cvelist"}],"published":"2026-11-30T13:36:48.960Z","modified":"2026-11-30T14:19:50.197Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"fc611f47f2188ade2b48ff6902d5cce8baac0c58","fixed":"6b810a303806b3a48c0d8cec99468956d15b8069","status":"affected"},{"type":"git","introduced":"fc611f47f2188ade2b48ff6902d5cce8baac0c58","fixed":"23fd50ed3ae8ff501e90db8b253ee05992a0b563","status":"affected"},{"type":"git","introduced":"fc611f47f2188ade2b48ff6902d5cce8baac0c58","fixed":"ad74f678b76e9460193afc1683ba50ae5d2f6400","status":"affected"},{"type":"git","introduced":"fc611f47f2188ade2b48ff6902d5cce8baac0c58","fixed":"d37ac6eda751255a96a46737abbb526ada2a1017","status":"affected"},{"type":"git","introduced":"fc611f47f2188ade2b48ff6902d5cce8baac0c58","fixed":"ab9f32e30ac4087a72070d8cc33809c02797e8ef","status":"affected"},{"type":"git","introduced":"fc611f47f2188ade2b48ff6902d5cce8baac0c58","fixed":"63fa671681dc8f10d1f21032bc6da1c3398c782b","status":"affected"},{"type":"git","introduced":"fc611f47f2188ade2b48ff6902d5cce8baac0c58","fixed":"c42da1d3ba9d5067cf3f0676b98bcb3f5f9e3ce1","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.7","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.7","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/6b810a303806b3a48c0d8cec99468956d15b8069","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/23fd50ed3ae8ff501e90db8b253ee05992a0b563","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ad74f678b76e9460193afc1683ba50ae5d2f6400","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d37ac6eda751255a96a46737abbb526ada2a1017","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ab9f32e30ac4087a72070d8cc33809c02797e8ef","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/63fa671681dc8f10d1f21032bc6da1c3398c782b","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c42da1d3ba9d5067cf3f0676b98bcb3f5f9e3ce1","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-139661","url":"https://www.cve.org/CVERecord?id=CVE-2026-139661","licence":"CVE Terms of Use","modified":"2026-11-30T13:36:48.960Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-139661","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-139661","licence":"Public domain","modified":"2026-11-30T14:19:50.197Z"}],"updatedAt":"2026-11-30T14:33:17.660Z","epss":{"score":0.00206,"percentile":0.11214,"date":"2026-12-01T12:00:22.000Z"}}