bpf, lsm: Reject writes into the BPF LSM program context

State
Published
Severity
Not Scored
Published
Nov 30, 2026
Updated
Nov 30, 2026
Reserved
Nov 30, 2026

Read the record on cve.org

Description

In the Linux kernel, the following vulnerability has been resolved:

bpf, lsm: Reject writes into the BPF LSM program context

The verifier types a load from a tracing-style context by its offset alone: btf_ctx_access() looks the offset up in the attach hook's prototype, and check_mem_access() stamps the resulting type onto the destination register. Nothing tracks what the slot actually holds. That is sound only as long as the context is read-only, and for BPF LSM it is not. lsm_verifier_ops wires ->is_valid_access() straight to btf_ctx_access(), which never looks at enum bpf_access_type, so a store into the context passes verification. Every other user of the helper either goes through bpf_tracing_btf_ctx_access() or open-codes the same type != BPF_READ test first; BPF LSM is the only one that does neither.

A program can therefore store a scalar of its choosing into a context slot, read the slot back, and get a register the verifier believes is a trusted pointer of the hook's argument type. Handing that to a kfunc or helper which dereferences a trusted argument turns it into an arbitrary kernel access. Route BPF LSM through bpf_tracing_btf_ctx_access() like everyone else.

ProductVersions
Linux Linuxfc611f47f2188ade2b48ff6902d5cce8baac0c58 to before 6b810a303806b3a48c0d8cec99468956d15b8069 Affectedfc611f47f2188ade2b48ff6902d5cce8baac0c58 to before 23fd50ed3ae8ff501e90db8b253ee05992a0b563 Affectedfc611f47f2188ade2b48ff6902d5cce8baac0c58 to before ad74f678b76e9460193afc1683ba50ae5d2f6400 Affectedfc611f47f2188ade2b48ff6902d5cce8baac0c58 to before d37ac6eda751255a96a46737abbb526ada2a1017 Affectedfc611f47f2188ade2b48ff6902d5cce8baac0c58 to before ab9f32e30ac4087a72070d8cc33809c02797e8ef Affectedfc611f47f2188ade2b48ff6902d5cce8baac0c58 to before 63fa671681dc8f10d1f21032bc6da1c3398c782b Affectedfc611f47f2188ade2b48ff6902d5cce8baac0c58 to before c42da1d3ba9d5067cf3f0676b98bcb3f5f9e3ce1 Affected
Linux Linux5.7 Affectedbefore 5.7 Not Affected5.15.226 through 5.15.* Not Affected6.1.193 through 6.1.* Not Affected6.6.163 through 6.6.* Not Affected6.12.119 through 6.12.* Not Affected6.18.65 through 6.18.* Not Affected7.3.6 through 7.3.* Not Affected7.4-rc1 and later Not Affected

Weaknesses

The record names no weakness.

References

Every record here comes from the CVE Program's CVE List. © 1999-2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.

© 2026 NVIDIA, the NVIDIA logo, and NVIDIA Inception are trademarks and/or registered trademarks of NVIDIA Corporation in the U.S. and other countries.