Re: [PATCH bpf-next 1/4] bpf: sockmap: enable map_update_elem from bpf_iter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux