]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tipc: re-order conditions in tipc_crypto_key_rcv()
authorDan Carpenter <dan.carpenter@linaro.org>
Fri, 17 Jan 2025 09:36:14 +0000 (12:36 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:19 +0000 (12:50 +0100)
commitf213bb330fc64eac5e66d3986b107f3612305f8f
treec7808ab3959d332e049e88061dc02417fcd9b799
parentc9b80829b001850f4f48497b0f2b2842c6a32c3a
tipc: re-order conditions in tipc_crypto_key_rcv()

[ Upstream commit 5fe71fda89745fc3cd95f70d06e9162b595c3702 ]

On a 32bit system the "keylen + sizeof(struct tipc_aead_key)" math could
have an integer wrapping issue.  It doesn't matter because the "keylen"
is checked on the next line, but just to make life easier for static
analysis tools, let's re-order these conditions and avoid the integer
overflow.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/tipc/crypto.c