All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Liu Shixin <liushixin2@huawei.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] crypto: algboss - Replaced simple_strtol() with kstrtouint()
Date: Mon, 24 May 2021 14:57:50 -0700	[thread overview]
Message-ID: <YKwhXlrJzdOjS9lJ@gmail.com> (raw)
In-Reply-To: <20210524120834.1580343-1-liushixin2@huawei.com>

On Mon, May 24, 2021 at 08:08:34PM +0800, Liu Shixin wrote:
> The simple_strtol() function is deprecated in some situation since
> it does not check for the range overflow. Use kstrtouint() instead.
> 
> Signed-off-by: Liu Shixin <liushixin2@huawei.com>
> ---
>  crypto/algboss.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/crypto/algboss.c b/crypto/algboss.c
> index 5ebccbd6b74e..64bb8dab9584 100644
> --- a/crypto/algboss.c
> +++ b/crypto/algboss.c
> @@ -140,8 +140,8 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
>  			param->attrs[i].nu32.attr.rta_len =
>  				sizeof(param->attrs[i].nu32);
>  			param->attrs[i].nu32.attr.rta_type = CRYPTOA_U32;
> -			param->attrs[i].nu32.data.num =
> -				simple_strtol(name, NULL, 0);
> +			if (unlikely(kstrtouint(name, 0, &param->attrs[i].nu32.data.num)))
> +				goto err_free_param;

It would be better to just remove all the code related to CRYPTOA_U32 and
crypto_attr_u32, as it is never used.

- Eric

  reply	other threads:[~2021-05-24 21:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 12:08 [PATCH -next] crypto: algboss - Replaced simple_strtol() with kstrtouint() Liu Shixin
2021-05-24 21:57 ` Eric Biggers [this message]
2021-06-03  8:12   ` Herbert Xu
2021-06-03 10:53     ` Liu Shixin
2021-06-03 11:50       ` 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=YKwhXlrJzdOjS9lJ@gmail.com \
    --to=ebiggers@kernel.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liushixin2@huawei.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.