[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210806083223.GB13132@gondor.apana.org.au>
Date: Fri, 6 Aug 2021 16:32:23 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Kai Ye <yekai13@...wei.com>
Cc: linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
wangzhou1@...ilicon.com
Subject: Re: [PATCH 3/5] crypto: hisilicon/sec - fix the max length of AAD
for the CCM mode
On Sat, Jul 31, 2021 at 11:26:34AM +0800, Kai Ye wrote:
>
> @@ -2218,6 +2219,10 @@ static int sec_aead_spec_check(struct sec_ctx *ctx, struct sec_req *sreq)
> }
>
> if (c_mode == SEC_CMODE_CCM) {
> + if (unlikely(req->assoclen > SEC_MAX_CCM_AAD_LEN)) {
> + dev_err(dev, "CCM input aad parameter is too long!\n");
> + return -EINVAL;
> + }
You shouldn't be printing messages on a code path that can be
triggered by userspace without rate limit.
Thanks,
--
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Powered by blists - more mailing lists