linux/kernel/bpf
Daniel Borkmann 3173c7c807 bpf: No need to simulate speculative domain for immediates
commit a7036191277f9fa68d92f2071ddc38c09b1e5ee5 upstream.

In 801c6058d14a ("bpf: Fix leakage of uninitialized bpf stack under
speculation") we replaced masking logic with direct loads of immediates
if the register is a known constant. Given in this case we do not apply
any masking, there is also no reason for the operation to be truncated
under the speculative domain.

Therefore, there is also zero reason for the verifier to branch-off and
simulate this case, it only needs to do it for unknown but bounded scalars.
As a side-effect, this also enables few test cases that were previously
rejected due to simulation under zero truncation.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Piotr Krysiuk <piotras@gmail.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-28 13:10:26 +02:00
..
arraymap.c
bpf_lru_list.c bpf_lru_list: Read double-checked variable once without lock 2021-03-04 10:26:16 +01:00
bpf_lru_list.h
btf.c
cgroup.c bpf, cgroup: Fix problematic bounds check 2021-02-10 09:25:27 +01:00
core.c bpf: Don't rely on GCC __attribute__((optimize)) to disable GCSE 2020-11-18 19:20:26 +01:00
cpumap.c
devmap.c
disasm.c
disasm.h
hashtab.c bpf: Zero-fill re-used per-cpu map element 2020-11-18 19:20:26 +01:00
helpers.c bpf: Fix helper bpf_map_peek_elem_proto pointing to wrong callback 2021-01-23 15:57:56 +01:00
inode.c
local_storage.c
lpm_trie.c
Makefile bpf: Don't rely on GCC __attribute__((optimize)) to disable GCSE 2020-11-18 19:20:26 +01:00
map_in_map.c
map_in_map.h
offload.c
percpu_freelist.c
percpu_freelist.h
queue_stack_maps.c
reuseport_array.c
stackmap.c bpf: Check for integer overflow when using roundup_pow_of_two() 2021-02-17 10:35:16 +01:00
syscall.c
sysfs_btf.c
tnum.c
verifier.c bpf: No need to simulate speculative domain for immediates 2021-05-28 13:10:26 +02:00
xskmap.c