[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200925215359.l5lbicqdyx44spoc@kafai-mbp>
Date: Fri, 25 Sep 2020 14:53:59 -0700
From: Martin KaFai Lau <kafai@...com>
To: Lorenz Bauer <lmb@...udflare.com>
CC: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
John Fastabend <john.fastabend@...il.com>,
Jakub Sitnicki <jakub@...udflare.com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>, <kernel-team@...udflare.com>,
<netdev@...r.kernel.org>, <bpf@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH bpf-next 1/4] bpf: sockmap: enable map_update_elem from
bpf_iter
On Fri, Sep 25, 2020 at 10:56:27AM +0100, Lorenz Bauer wrote:
[ ... ]
> diff --git a/net/core/sock_map.c b/net/core/sock_map.c
> index e1f05e3fa1d0..497e7df466d4 100644
> --- a/net/core/sock_map.c
> +++ b/net/core/sock_map.c
> @@ -610,6 +610,9 @@ static int sock_map_update_elem(struct bpf_map *map, void *key,
> struct sock *sk = (struct sock *)value;
> int ret;
>
> + if (unlikely(!sk))
sk_fullsock(sk) test is also needed.
> + return -EINVAL;
> +
> if (!sock_map_sk_is_suitable(sk))
sk->sk_type is used in sock_map_sk_is_suitable().
sk_type is not in sock_common.
Powered by blists - more mailing lists