WSL2-Linux-Kernel/kernel/bpf
Alexei Starovoitov 4fe8435909 bpf: convert htab map to hlist_nulls
when all map elements are pre-allocated one cpu can delete and reuse htab_elem
while another cpu is still walking the hlist. In such case the lookup may
miss the element. Convert hlist to hlist_nulls to avoid such scenario.
When bucket lock is taken there is no need to take such precautions,
so only convert map_lookup and map_get_next to nulls.
The race window is extremely small and only reproducible with explicit
udelay() inside lookup_nulls_elem_raw()

Similar to hlist add hlist_nulls_for_each_entry_safe() and
hlist_nulls_entry_safe() helpers.

Fixes: 6c90598174 ("bpf: pre-allocate hash map elements")
Reported-by: Jonathan Perry <jonperry@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-09 13:27:17 -08:00
..
Makefile
arraymap.c
bpf_lru_list.c
bpf_lru_list.h
cgroup.c
core.c
hashtab.c bpf: convert htab map to hlist_nulls 2017-03-09 13:27:17 -08:00
helpers.c
inode.c
lpm_trie.c bpf: add get_next_key callback to LPM map 2017-03-05 17:55:29 -08:00
percpu_freelist.c
percpu_freelist.h
stackmap.c
syscall.c sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h> 2017-03-02 08:42:29 +01:00
verifier.c