android_kernel_motorola_sm6375/kernel/bpf
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Florian Lehner dc843ed97d bpf, lpm: Fix check prefixlen before walking trie
[ Upstream commit 9b75dbeb36fcd9fc7ed51d370310d0518a387769 ]

When looking up an element in LPM trie, the condition 'matchlen ==
trie->max_prefixlen' will never return true, if key->prefixlen is larger
than trie->max_prefixlen. Consequently all elements in the LPM trie will
be visited and no element is returned in the end.

To resolve this, check key->prefixlen first before walking the LPM trie.

Fixes: b95a5c4db0 ("bpf: add a longest prefix match trie map implementation")
Signed-off-by: Florian Lehner <dev@der-flo.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20231105085801.3742-1-dev@der-flo.net
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-25 14:34:24 -08:00
..
arraymap.c
bpf_lru_list.c bpf: Address KCSAN report on bpf_lru_list 2023-07-27 08:37:42 +02:00
bpf_lru_list.h bpf: Address KCSAN report on bpf_lru_list 2023-07-27 08:37:42 +02:00
btf.c btf: fix resolving BTF_KIND_VAR after ARRAY, STRUCT, UNION, PTR 2023-03-17 08:32:51 +01:00
cgroup.c bpf: Don't EFAULT for getsockopt with optval=NULL 2023-05-17 11:35:44 +02:00
core.c bpf: Adjust insufficient default bpf_jit_limit 2023-04-05 11:16:37 +02:00
cpumap.c
devmap.c bpf: Fix integer overflow in argument calculation for bpf_map_area_alloc 2021-12-17 10:12:24 +01:00
disasm.c bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-15 09:47:38 +02:00
disasm.h
hashtab.c
helpers.c
inode.c
local_storage.c
lpm_trie.c bpf, lpm: Fix check prefixlen before walking trie 2024-01-25 14:34:24 -08:00
Makefile
map_in_map.c
map_in_map.h
offload.c
percpu_freelist.c
percpu_freelist.h
queue_stack_maps.c bpf: Avoid deadlock when using queue and stack maps from NMI 2023-10-10 21:46:36 +02:00
reuseport_array.c
stackmap.c bpf: Fix incorrect memory charge cost calculation in stack_map_alloc() 2022-06-22 14:11:02 +02:00
syscall.c bpf: Ensure correct locking around vulnerable function find_vpid() 2022-10-26 13:22:24 +02:00
sysfs_btf.c
tnum.c
verifier.c bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END 2023-11-28 16:50:18 +00:00
xskmap.c