diff options
author | Xin Long <lucien.xin@gmail.com> | 2021-12-10 13:50:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-12-13 12:31:36 +0000 |
commit | 6180c780e64ceb8dd23345b586dfa70c0a1536ee (patch) | |
tree | c1244851cd59e01268ff38aef371f7f2b6646903 /net/tipc | |
parent | 3a6c12a0c6c3f857f47efe0e40011360063a35bc (diff) | |
download | linux-stable-6180c780e64ceb8dd23345b586dfa70c0a1536ee.tar.gz linux-stable-6180c780e64ceb8dd23345b586dfa70c0a1536ee.tar.bz2 linux-stable-6180c780e64ceb8dd23345b586dfa70c0a1536ee.zip |
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>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/link.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tipc/link.c b/net/tipc/link.c index 09ae8448f394..8d9e09f48f4c 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; } |