Skip to content

Commit 3ccdcee

Browse files
YunDingLabAlexei Starovoitov
authored andcommitted
bpf: Add missing map_get_next_key method to bloom filter map.
Without it, kernel crashes in map_get_next_key(). Fixes: 9330986 ("bpf: Add bloom filter map implementation") Reported-by: TCS Robot <tcs_robot@tencent.com> Signed-off-by: Haimin Zhang <tcs_kernel@tencent.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org> Acked-by: Joanne Koong <joannekoong@fb.com> Link: https://lore.kernel.org/bpf/1640776802-22421-1-git-send-email-tcs.kernel@gmail.com
1 parent b645941 commit 3ccdcee

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

kernel/bpf/bloom_filter.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,11 @@ static int bloom_map_delete_elem(struct bpf_map *map, void *value)
8282
return -EOPNOTSUPP;
8383
}
8484

85+
static int bloom_map_get_next_key(struct bpf_map *map, void *key, void *next_key)
86+
{
87+
return -EOPNOTSUPP;
88+
}
89+
8590
static struct bpf_map *bloom_map_alloc(union bpf_attr *attr)
8691
{
8792
u32 bitset_bytes, bitset_mask, nr_hash_funcs, nr_bits;
@@ -192,6 +197,7 @@ const struct bpf_map_ops bloom_filter_map_ops = {
192197
.map_meta_equal = bpf_map_meta_equal,
193198
.map_alloc = bloom_map_alloc,
194199
.map_free = bloom_map_free,
200+
.map_get_next_key = bloom_map_get_next_key,
195201
.map_push_elem = bloom_map_push_elem,
196202
.map_peek_elem = bloom_map_peek_elem,
197203
.map_pop_elem = bloom_map_pop_elem,

0 commit comments

Comments
 (0)