From: Paolo Abeni Date: Thu, 23 Jul 2020 11:02:34 +0000 (+0200) Subject: subflow: explicitly check for plain tcp rsk X-Git-Tag: v5.10.7~1943^2~145^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b7514694ed2952684a1e4fc44d83682140fd8cef;p=platform%2Fkernel%2Flinux-rpi.git subflow: explicitly check for plain tcp rsk When syncookie are in use, the TCP stack may feed into subflow_syn_recv_sock() plain TCP request sockets. We can't access mptcp_subflow_request_sock-specific fields on such sockets. Explicitly check the rsk ops to do safe accesses. Reviewed-by: Mat Martineau Tested-by: Christoph Paasch Signed-off-by: Paolo Abeni Signed-off-by: David S. Miller --- diff --git a/net/mptcp/subflow.c b/net/mptcp/subflow.c index 7f3ef18..3ef445f 100644 --- a/net/mptcp/subflow.c +++ b/net/mptcp/subflow.c @@ -415,7 +415,7 @@ static struct sock *subflow_syn_recv_sock(const struct sock *sk, /* hopefully temporary handling for MP_JOIN+syncookie */ subflow_req = mptcp_subflow_rsk(req); - fallback_is_fatal = subflow_req->mp_join; + fallback_is_fatal = tcp_rsk(req)->is_mptcp && subflow_req->mp_join; fallback = !tcp_rsk(req)->is_mptcp; if (fallback) goto create_child;