mptcp: fix security context on server socket
authorPaolo Abeni <pabeni@redhat.com>
Wed, 16 Dec 2020 11:48:32 +0000 (12:48 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 17 Dec 2020 18:24:47 +0000 (10:24 -0800)
Currently MPTCP is not propagating the security context
from the ingress request socket to newly created msk
at clone time.

Address the issue invoking the missing security helper.

Fixes: cf7da0d66cc1 ("mptcp: Create SUBFLOW socket for incoming connections")
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c

index b812aaae8044db3bb1e8ae084f46480b3f034f20..d24243a28fced90b9dfbb1ffd8c9bf3de47167dd 100644 (file)
@@ -2699,6 +2699,8 @@ struct sock *mptcp_sk_clone(const struct sock *sk,
        sock_reset_flag(nsk, SOCK_RCU_FREE);
        /* will be fully established after successful MPC subflow creation */
        inet_sk_state_store(nsk, TCP_SYN_RECV);
+
+       security_inet_csk_clone(nsk, req);
        bh_unlock_sock(nsk);
 
        /* keep a single reference */