lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 24 May 2021 14:57:50 -0700
From:   Eric Biggers <ebiggers@...nel.org>
To:     Liu Shixin <liushixin2@...wei.com>
Cc:     Herbert Xu <herbert@...dor.apana.org.au>,
        "David S. Miller" <davem@...emloft.net>,
        linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] crypto: algboss - Replaced simple_strtol() with
 kstrtouint()

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@...wei.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ