[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aLK8HN_33c2Nvhe5@gondor.apana.org.au>
Date: Sat, 30 Aug 2025 16:53:48 +0800
From: Herbert Xu <herbert@...dor.apana.org.au>
To: Qianfeng Rong <rongqianfeng@...o.com>
Cc: Giovanni Cabiddu <giovanni.cabiddu@...el.com>,
"David S. Miller" <davem@...emloft.net>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Jack Xu <jack.xu@...el.com>,
Suman Kumar Chakraborty <suman.kumar.chakraborty@...el.com>,
Colin Ian King <colin.i.king@...il.com>, qat-linux@...el.com,
linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] crypto: qat - use kcalloc() in
qat_uclo_map_objs_from_mof()
On Thu, Aug 21, 2025 at 10:20:26PM +0800, Qianfeng Rong wrote:
> As noted in the kernel documentation [1], open-coded multiplication in
> allocator arguments is discouraged because it can lead to integer overflow.
>
> Use kcalloc() to gain built-in overflow protection, making memory
> allocation safer when calculating allocation size compared to explicit
> multiplication. Similarly, use size_add() instead of explicit addition
> for 'uobj_chunk_num + sobj_chunk_num'.
>
> Link: https://www.kernel.org/doc/html/next/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments #1
> Signed-off-by: Qianfeng Rong <rongqianfeng@...o.com>
> ---
> v2: Changed explicit addition 'uobj_chunk_num + sobj_chunk_num' to use
> size_add().
> v3: Revise the version description to keep it consistent with the changes.
> ---
> drivers/crypto/intel/qat/qat_common/qat_uclo.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