]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tcp_bpf: Charge receive socket buffer in bpf_tcp_ingress()
authorCong Wang <cong.wang@bytedance.com>
Tue, 10 Dec 2024 01:20:38 +0000 (01:20 +0000)
committerDaniel Borkmann <daniel@iogearbox.net>
Fri, 20 Dec 2024 16:59:47 +0000 (17:59 +0100)
commit54f89b3178d5448dd4457afbb98fc1ab99090a65
treedb313b7069a0cf84afe847dfdb5dccd49b98da70
parent716f2bca1ce93bb95364f1fc0555c1650507b588
tcp_bpf: Charge receive socket buffer in bpf_tcp_ingress()

When bpf_tcp_ingress() is called, the skmsg is being redirected to the
ingress of the destination socket. Therefore, we should charge its
receive socket buffer, instead of sending socket buffer.

Because sk_rmem_schedule() tests pfmemalloc of skb, we need to
introduce a wrapper and call it for skmsg.

Fixes: 604326b41a6f ("bpf, sockmap: convert to generic sk_msg interface")
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Reviewed-by: John Fastabend <john.fastabend@gmail.com>
Link: https://lore.kernel.org/bpf/20241210012039.1669389-2-zijianzhang@bytedance.com
include/net/sock.h
net/ipv4/tcp_bpf.c