From: Xin Long Date: Fri, 10 Dec 2021 18:50:40 +0000 (-0500) Subject: tipc: discard MSG_CRYPTO msgs when key_exchange_enabled is not set X-Git-Tag: v6.6.17~8491^2~218 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6180c780e64ceb8dd23345b586dfa70c0a1536ee;p=platform%2Fkernel%2Flinux-rpi.git tipc: discard MSG_CRYPTO msgs when key_exchange_enabled is not set When key_exchange is disabled, there is no reason to accept MSG_CRYPTO msgs if it doesn't send MSG_CRYPTO msgs. Signed-off-by: Xin Long Acked-by: Jon Maloy Signed-off-by: David S. Miller --- diff --git a/net/tipc/link.c b/net/tipc/link.c index 09ae844..8d9e09f 100644 --- a/net/tipc/link.c +++ b/net/tipc/link.c @@ -1298,7 +1298,8 @@ static bool tipc_data_input(struct tipc_link *l, struct sk_buff *skb, return false; #ifdef CONFIG_TIPC_CRYPTO case MSG_CRYPTO: - if (TIPC_SKB_CB(skb)->decrypted) { + if (sysctl_tipc_key_exchange_enabled && + TIPC_SKB_CB(skb)->decrypted) { tipc_crypto_msg_rcv(l->net, skb); return true; }