diff options
author | Hangyu Hua <hbh25y@gmail.com> | 2022-02-11 12:55:10 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-03-08 19:12:30 +0100 |
commit | 5340a0924ea9c07c5d9a7c5476317731131eead2 (patch) | |
tree | 7d571725f0cf40f76eb34e00e7c99f843dd5faf5 /net/tipc | |
parent | 1ccc12f2240a76fe38df909628267c72f5772d90 (diff) | |
download | linux-stable-5340a0924ea9c07c5d9a7c5476317731131eead2.tar.gz linux-stable-5340a0924ea9c07c5d9a7c5476317731131eead2.tar.bz2 linux-stable-5340a0924ea9c07c5d9a7c5476317731131eead2.zip |
tipc: fix a bit overflow in tipc_crypto_key_rcv()
[ Upstream commit 143de8d97d79316590475dc2a84513c63c863ddf ]
msg_data_sz return a 32bit value, but size is 16bit. This may lead to a
bit overflow.
Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/crypto.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tipc/crypto.c b/net/tipc/crypto.c index d293614d5fc6..b5074957e881 100644 --- a/net/tipc/crypto.c +++ b/net/tipc/crypto.c @@ -2287,7 +2287,7 @@ static bool tipc_crypto_key_rcv(struct tipc_crypto *rx, struct tipc_msg *hdr) struct tipc_crypto *tx = tipc_net(rx->net)->crypto_tx; struct tipc_aead_key *skey = NULL; u16 key_gen = msg_key_gen(hdr); - u16 size = msg_data_sz(hdr); + u32 size = msg_data_sz(hdr); u8 *data = msg_data(hdr); unsigned int keylen; |