Re: [PATCH v2] crypto: qat - use simple_strtoull to improve qat_uclo_parse_num
From: Herbert Xu
Date: Fri Oct 31 2025 - 05:52:17 EST
On Sun, Oct 26, 2025 at 02:57:07AM +0100, Thorsten Blum wrote:
> Replace the manual string copying and parsing logic with a call to
> simple_strtoull() to simplify and improve qat_uclo_parse_num().
>
> Ensure that the parsed number does not exceed UINT_MAX, and add an
> approximate upper-bound check (no more than 19 digits) to guard against
> overflow.
>
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> ---
> Changes in v2:
> - Use simple_strtoull(), return -EINVAL, and guard against overflow as
> suggested by Andy
> - Link to v1: https://lore.kernel.org/lkml/20251022123622.349544-1-thorsten.blum@xxxxxxxxx/
> ---
> drivers/crypto/intel/qat/qat_common/qat_uclo.c | 18 +++++-------------
> 1 file changed, 5 insertions(+), 13 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