bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joanne Koong <joannekoong@fb.com>
To: <tcs.kernel@gmail.com>, <ast@kernel.org>, <daniel@iogearbox.net>,
	<andrii@kernel.org>, <kafai@fb.com>, <songliubraving@fb.com>,
	<yhs@fb.com>, <john.fastabend@gmail.com>, <kpsingh@kernel.org>,
	<bpf@vger.kernel.org>
Cc: Haimin Zhang <tcs_kernel@tencent.com>
Subject: Re: [PATCH v2] bpf: Add missing map_get_next_key method to bloom filter map
Date: Wed, 29 Dec 2021 09:21:44 -0800	[thread overview]
Message-ID: <1c8f6a26-658c-8986-2186-7e1868850cc2@fb.com> (raw)
In-Reply-To: <1640776802-22421-1-git-send-email-tcs.kernel@gmail.com>

On 12/29/21 3:20 AM, tcs.kernel@gmail.com wrote:

> From: Haimin Zhang <tcs_kernel@tencent.com>
>
> Without it, kernel crashes in map_get_next_key().
>
> Fixes: 9330986c0300 ("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: Daniel Borkmann <daniel@iogearbox.net>
> ---

Thanks for fixing this. I'll take a look at the other bpf_map_ops and see if
there are other missing ones.

Acked-by: Joanne Koong <joannekoong@fb.com>
>   kernel/bpf/bloom_filter.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/kernel/bpf/bloom_filter.c b/kernel/bpf/bloom_filter.c
> index 277a05e9c984..fa34dc871995 100644
> --- a/kernel/bpf/bloom_filter.c
> +++ b/kernel/bpf/bloom_filter.c
> @@ -82,6 +82,11 @@ static int bloom_map_delete_elem(struct bpf_map *map, void *value)
>   	return -EOPNOTSUPP;
>   }
>   
> +static int bloom_map_get_next_key(struct bpf_map *map, void *key, void *next_key)
> +{
> +	return -EOPNOTSUPP;
> +}
> +
>   static struct bpf_map *bloom_map_alloc(union bpf_attr *attr)
>   {
>   	u32 bitset_bytes, bitset_mask, nr_hash_funcs, nr_bits;
> @@ -192,6 +197,7 @@ const struct bpf_map_ops bloom_filter_map_ops = {
>   	.map_meta_equal = bpf_map_meta_equal,
>   	.map_alloc = bloom_map_alloc,
>   	.map_free = bloom_map_free,
> +	.map_get_next_key = bloom_map_get_next_key,
>   	.map_push_elem = bloom_map_push_elem,
>   	.map_peek_elem = bloom_map_peek_elem,
>   	.map_pop_elem = bloom_map_pop_elem,

  reply	other threads:[~2021-12-29 17:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-29 11:20 [PATCH v2] bpf: Add missing map_get_next_key method to bloom filter map tcs.kernel
2021-12-29 17:21 ` Joanne Koong [this message]
2021-12-29 17:41   ` Alexei Starovoitov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1c8f6a26-658c-8986-2186-7e1868850cc2@fb.com \
    --to=joannekoong@fb.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=john.fastabend@gmail.com \
    --cc=kafai@fb.com \
    --cc=kpsingh@kernel.org \
    --cc=songliubraving@fb.com \
    --cc=tcs.kernel@gmail.com \
    --cc=tcs_kernel@tencent.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).