]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - net/tipc/link.c
tipc: only accept encrypted MSG_CRYPTO msgs
authorXin Long <lucien.xin@gmail.com>
Mon, 15 Nov 2021 12:45:24 +0000 (07:45 -0500)
committerAndrea Righi <andrea.righi@canonical.com>
Tue, 4 Jan 2022 08:48:48 +0000 (09:48 +0100)
commit1c7ec48a63fe23ce58e4e74535e8657f0f114ef4
tree24777a947f6ebd192c284a3452bfff3160e99840
parent457b95677bbb4dd842caf2a485f01deca693b5bb
tipc: only accept encrypted MSG_CRYPTO msgs

BugLink: https://bugs.launchpad.net/bugs/1952579
[ Upstream commit 271351d255b09e39c7f6437738cba595f9b235be ]

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: 1ef6f7c9390f ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
net/tipc/link.c