Re: [PATCH] crypto: keembay: ocs-aes: use 64-bit arithmetic for computing bit_len

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 15, 2021 at 10:46:05PM +0200, Ovidiu Panait wrote:
> src_size and aad_size are defined as u32, so the following expressions are
> currently being evaluated using 32-bit arithmetic:
> 
> bit_len = src_size * 8;
> ...
> bit_len = aad_size * 8;
> 
> However, bit_len is used afterwards in a context that expects a valid
> 64-bit value (the lower and upper 32-bit words of bit_len are extracted
> and written to hw).
> 
> In order to make sure the correct bit length is generated and the 32-bit
> multiplication does not wrap around, cast src_size and aad_size to u64.
> 
> Signed-off-by: Ovidiu Panait <ovidiu.panait@xxxxxxxxxxxxx>
> ---
>  drivers/crypto/keembay/ocs-aes.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Patch applied.  Thanks.
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux