]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: sockmap, sk_wait_event needed to handle blocking cases
authorJohn Fastabend <john.fastabend@gmail.com>
Mon, 23 Apr 2018 22:39:28 +0000 (15:39 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 23 Apr 2018 22:49:45 +0000 (00:49 +0200)
commit2f9db86c6441955d14720ec00f51d8c8220db42f
tree79f30f5474ae45cc9b5663316b6a5f0e1bedd028
parent0e2da312901dda9cd6c500a904219238d41e998e
bpf: sockmap, sk_wait_event needed to handle blocking cases

In the recvmsg handler we need to add a wait event to support the
blocking use cases. Without this we return zero and may confuse
user applications. In the wait event any data received on the
sk either via sk_receive_queue or the psock ingress list will
wake up the sock.

Fixes: 133c421e7cb6 ("bpf: sockmap, BPF_F_INGRESS flag for BPF_SK_SKB_STREAM_VERDICT")
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
kernel/bpf/sockmap.c