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

2020-09-28 Thread Martin KaFai Lau
On Mon, Sep 28, 2020 at 10:08:02AM +0100, Lorenz Bauer wrote: > Allow passing a pointer to a BTF struct sock_common* when updating > a sockmap or sockhash. Since BTF pointers can fault and therefore be > NULL at runtime we need to add an additional !sk check to > sock_map_update_elem. Since we may

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

2020-09-28 Thread Lorenz Bauer
Allow passing a pointer to a BTF struct sock_common* when updating a sockmap or sockhash. Since BTF pointers can fault and therefore be NULL at runtime we need to add an additional !sk check to sock_map_update_elem. Since we may be passed a request or timewait socket we also need to check sk_fullso