diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c
index dcd1c76d2a3b..6e5e64c2cf89 100644
--- a/net/mptcp/sockopt.c
+++ b/net/mptcp/sockopt.c
@@ -1493,6 +1493,9 @@ int mptcp_set_rcvlowat(struct sock *sk, int val)
struct mptcp_subflow_context *subflow;
int space, cap;
+ if (has_current_bpf_ctx())
+ return -EINVAL;
+
if (sk->sk_userlocks & SOCK_RCVBUF_LOCK)
cap = sk->sk_rcvbuf >> 1;
else
It looks like it is an issue specific to RCVLOWAT because sk_setsockopt(SO_RCVLOWAT) will call sk-> sk_socket->ops->set_rcvlowat(). BPF touch the mptcp main socket, which is not protected by the subflow socket lock in this case.
Alexei shared this splat:
Paolo suggested:
It looks like it is an issue specific to
RCVLOWAT
becausesk_setsockopt(SO_RCVLOWAT)
will callsk-> sk_socket->ops->set_rcvlowat()
. BPF touch the mptcp main socket, which is not protected by the subflow socket lock in this case.