mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
crypto: af_alg - Cap AEAD AD length to 0x80000000
In order to prevent arithmetic overflows when checking the TX
buffer size, cap the associated data length to 0x80000000.
Reported-by: Yiming Qian <yimingqian591@gmail.com>
Fixes: 400c40cf78 ("crypto: algif - add AEAD support")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
ffdd2bc378
commit
e4c06479d7
|
|
@ -584,6 +584,8 @@ static int af_alg_cmsg_send(struct msghdr *msg, struct af_alg_control *con)
|
|||
if (cmsg->cmsg_len < CMSG_LEN(sizeof(u32)))
|
||||
return -EINVAL;
|
||||
con->aead_assoclen = *(u32 *)CMSG_DATA(cmsg);
|
||||
if (con->aead_assoclen >= 0x80000000u)
|
||||
return -EINVAL;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user