Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <lucien.xin@gmail.com>
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Xin Long and committed by
David S. Miller
6180c780 3a6c12a0

+2 -1
+2 -1
net/tipc/link.c
··· 1298 1298 return false; 1299 1299 #ifdef CONFIG_TIPC_CRYPTO 1300 1300 case MSG_CRYPTO: 1301 - if (TIPC_SKB_CB(skb)->decrypted) { 1301 + if (sysctl_tipc_key_exchange_enabled && 1302 + TIPC_SKB_CB(skb)->decrypted) { 1302 1303 tipc_crypto_msg_rcv(l->net, skb); 1303 1304 return true; 1304 1305 }