+ |
kernel/bpf/verifier.c in the Linux kernel through 5.12.1 performs undesirable speculative loads, leading to disclosure of stack content via side-channel attacks, aka CID-801c6058d14a. The specific concern is not protecting the BPF stack area against speculative loads. Also, the BPF stack can contain uninitialized data that might represent sensitive information previously operated on by the kernel. |
- |
An issue has been discovered in the Linux kernel mechanism to mitigate speculative loads (Spectre mitigation). Unprivileged BPF programs running on affected systems can bypass |
- |
the protection and execute speculative loads from the kernel stack. This can be abused to extract contents of the stack via side-channel. The extracted contents may include addresses of kernel structures that could be used to defeat Kernel Address Space Layout Randomization (KASLR) to facilitate exploitation of other vulnerabilities. |
- |
|
- |
The identified gap is that when protecting BPF stack pointer against speculative pointer arithmetic, the BPF stack area itself is not protected against speculative loads. This could be abused to perform speculative loads from any location within the BPF stack. And so any restricted data from the BPF stack could be disclosed, such as addresses of data structures referred by the BPF program. Further, the original content of kernel memory is not wiped when allocating the BPF stack, and could be disclosed as well. |