]> git.baikalelectronics.ru Git - kernel.git/commit
bpf, sockmap: Ensure SO_RCVBUF memory is observed on ingress redirect
authorJohn Fastabend <john.fastabend@gmail.com>
Mon, 16 Nov 2020 22:28:06 +0000 (14:28 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Tue, 17 Nov 2020 23:12:34 +0000 (00:12 +0100)
commit9d0e81c1f2a7e62ef0f1b8c422bc1d8d4bc733b0
tree28849770d1faadc2117ca1fd60799173cf46231d
parent9f55629c7a8a4dfaa364d6ef2a6b3f0b34f502c1
bpf, sockmap: Ensure SO_RCVBUF memory is observed on ingress redirect

Fix sockmap sk_skb programs so that they observe sk_rcvbuf limits. This
allows users to tune SO_RCVBUF and sockmap will honor them.

We can refactor the if(charge) case out in later patches. But, keep this
fix to the point.

Fixes: 040dda931bce0 ("bpf: skb_verdict, support SK_PASS on RX BPF path")
Suggested-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com>
Link: https://lore.kernel.org/bpf/160556568657.73229.8404601585878439060.stgit@john-XPS-13-9370
net/core/skmsg.c
net/ipv4/tcp_bpf.c