Re: [PATCH bpf 5/5] bpf, sockmap: fix sock_map_ctx_update_elem race with exist/noexist

2018-08-16 Thread Song Liu
On Thu, Aug 16, 2018 at 12:49 PM, Daniel Borkmann wrote: > The current code in sock_map_ctx_update_elem() allows for BPF_EXIST > and BPF_NOEXIST map update flags. While on array-like maps this approach > is rather uncommon, e.g. bpf_fd_array_map_update_elem() and others > enforce map update flags

[PATCH bpf 5/5] bpf, sockmap: fix sock_map_ctx_update_elem race with exist/noexist

2018-08-16 Thread Daniel Borkmann
The current code in sock_map_ctx_update_elem() allows for BPF_EXIST and BPF_NOEXIST map update flags. While on array-like maps this approach is rather uncommon, e.g. bpf_fd_array_map_update_elem() and others enforce map update flags to be BPF_ANY such that xchg() can be used directly, the current i