[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20210917032135.GI6559@gondor.apana.org.au>
Date: Fri, 17 Sep 2021 11:21:35 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Shreyansh Chouhan <chouhan.shreyansh630@...il.com>
Cc: davem@...emloft.net, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, x86@...nel.org, hpa@...or.com,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org,
Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH] crypto: x86/aes-ni - check walk.nbytes instead of err
On Sat, Sep 11, 2021 at 04:37:59PM +0530, Shreyansh Chouhan wrote:
> In the code for xts_crypt(), we check for the err value returned by
> skcipher_walk_virt() and return from the function if it is non zero.
> However, skcipher_walk_virt() can set walk.nbytes to 0, which would cause
> us to call kernel_fpu_begin(), and then skip the kernel_fpu_end() call.
>
> This patch checks for the walk.nbytes value instead, and returns if
> walk.nbytes is 0. This prevents us from calling kernel_fpu_begin() in
> the first place and also covers the case of having a non zero err value
> returned from skcipher_walk_virt().
>
> Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
> Signed-off-by: Shreyansh Chouhan <chouhan.shreyansh630@...il.com>
> ---
> arch/x86/crypto/aesni-intel_glue.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Patch applied. 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