Skip to content

Commit

Permalink
tipc: fix a bit overflow in tipc_crypto_key_rcv()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
HBh25Y authored and davem330 committed Feb 13, 2022
1 parent bf8e59f commit 143de8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/tipc/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -2276,7 +2276,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;

Expand Down

0 comments on commit 143de8d

Please sign in to comment.