Files
twx-linux/include/linux
Alexei Starovoitov 82303dd64a bpf: convert htab map to hlist_nulls
commit 4fe8435909 upstream.

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>
Signed-off-by: Chenbo Feng <fengc@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-05-16 19:43:40 +02:00
..
2019-04-17 08:36:45 +02:00
2019-04-20 09:07:54 +02:00
2019-03-23 13:19:52 +01:00
2018-10-10 08:53:18 +02:00
2019-05-10 17:52:09 +02:00
2018-09-09 20:01:20 +02:00
2019-04-17 08:36:39 +02:00
2018-11-13 11:17:02 -08:00
2018-11-27 16:09:41 +01:00
2018-12-05 19:42:42 +01:00