From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Qianfeng Rong <rongqianfeng@vivo.com>
Cc: Giovanni Cabiddu <giovanni.cabiddu@intel.com>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Jack Xu <jack.xu@intel.com>,
Suman Kumar Chakraborty <suman.kumar.chakraborty@intel.com>,
Colin Ian King <colin.i.king@gmail.com>,
qat-linux@intel.com, linux-crypto@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3] crypto: qat - use kcalloc() in qat_uclo_map_objs_from_mof()
Date: Thu, 21 Aug 2025 18:40:30 +0300 [thread overview]
Message-ID: <aKc97iuDAiIacRiL@smile.fi.intel.com> (raw)
In-Reply-To: <20250821142028.33256-1-rongqianfeng@vivo.com>
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'.
FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-08-21 15:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-21 14:20 [PATCH v3] crypto: qat - use kcalloc() in qat_uclo_map_objs_from_mof() Qianfeng Rong
2025-08-21 15:40 ` Andy Shevchenko [this message]
2025-08-27 13:40 ` Giovanni Cabiddu
2025-08-30 8:53 ` Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aKc97iuDAiIacRiL@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=colin.i.king@gmail.com \
--cc=davem@davemloft.net \
--cc=giovanni.cabiddu@intel.com \
--cc=herbert@gondor.apana.org.au \
--cc=jack.xu@intel.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qat-linux@intel.com \
--cc=rongqianfeng@vivo.com \
--cc=suman.kumar.chakraborty@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.