diff --git a/net/mptcp/sockopt.c b/net/mptcp/sockopt.c index 3977332c44c0..bdfeecea814f 100644 --- a/net/mptcp/sockopt.c +++ b/net/mptcp/sockopt.c @@ -1538,6 +1538,10 @@ int mptcp_set_rcvlowat(struct sock *sk, int val) struct mptcp_subflow_context *subflow; int space, cap; + /* bpf can land here with a wrong sk type */ + if (sk->sk_protocol == IPPROTO_TCP) + return -EINVAL; + if (sk->sk_userlocks & SOCK_RCVBUF_LOCK) cap = sk->sk_rcvbuf >> 1; else