The next patch exposes a new kfunc calling __tcp_set_rcvlowat()
to bpf_tcp_ops.
MPTCP has its own sock->ops->set_rcvlowat() / mptcp_set_rcvlowat(),
so we should not allow calling __tcp_set_rcvlowat() on MPTCP
subflows.
Let's disable BPF_TCP_OPS_FLAG_RCVQ for MPTCP for now.
If needed in the future, bpf_tcp_ops_set_rcvlowat() could be
extended to properly support MPTCP.
Signed-off-by: Kuniyuki Iwashima <kuniyu@google.com>
---
net/ipv4/bpf_tcp_ops.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/net/ipv4/bpf_tcp_ops.c b/net/ipv4/bpf_tcp_ops.c
index dafe2337f9fc..c73d3478a8d5 100644
--- a/net/ipv4/bpf_tcp_ops.c
+++ b/net/ipv4/bpf_tcp_ops.c
@@ -347,6 +347,9 @@ __bpf_kfunc int bpf_tcp_ops_set_flags(struct tcp_sock *tp, u32 enable, u32 disab
if ((enable & disable) || (enable | disable) & ~BPF_TCP_OPS_FLAG_ALL)
return -EINVAL;
+ if (sk_is_mptcp((struct sock *)tp) && (enable & BPF_TCP_OPS_FLAG_RCVQ))
+ return -EOPNOTSUPP;
+
old = READ_ONCE(tp->bpf_tcp_ops_flags);
do {--
2.56.0.rc1.315.gc6ed9934b7-goog