]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: only accept encrypted MSG_CRYPTO msgs
authorXin Long <lucien.xin@gmail.com>
Mon, 15 Nov 2021 12:45:24 +0000 (07:45 -0500)
committerDavid S. Miller <davem@davemloft.net>
Mon, 15 Nov 2021 14:25:22 +0000 (14:25 +0000)
commitce870c9096dd5dfaaff388a18525afad52155749
treef7bc26b843f77b5e084de4515f1497efbad1b21d
parentf2e89138e71c403369d91a2ce3567d0adfbf707d
tipc: only accept encrypted MSG_CRYPTO msgs

The MSG_CRYPTO msgs are always encrypted and sent to other nodes
for keys' deployment. But when receiving in peers, if those nodes
do not validate it and make sure it's encrypted, one could craft
a malicious MSG_CRYPTO msg to deploy its key with no need to know
other nodes' keys.

This patch is to do that by checking TIPC_SKB_CB(skb)->decrypted
and discard it if this packet never got decrypted.

Note that this is also a supplementary fix to CVE-2021-43267 that
can be triggered by an unencrypted malicious MSG_CRYPTO msg.

Fixes: 9c57edf86ba6 ("tipc: add automatic session key exchange")
Acked-by: Ying Xue <ying.xue@windriver.com>
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c