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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 27 Aug 2021 12:33:39 -0700
From:   Joe Perches <joe@...ches.com>
To:     Herbert Xu <herbert@...dor.apana.org.au>,
        kernel test robot <lkp@...el.com>
Cc:     Kai Ye <yekai13@...wei.com>, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org,
        Linux Crypto Mailing List <linux-crypto@...r.kernel.org>
Subject: Re: crypto: hisilicon - Fix sscanf format signedness

On Fri, 2021-08-27 at 16:43 +0800, Herbert Xu wrote:
> The function qm_qos_value_init expects an unsigned integer but
> is incorrectly supplying a signed format to sscanf.  This patch
> fixes it.
[]
> diff --git a/drivers/crypto/hisilicon/qm.c b/drivers/crypto/hisilicon/qm.c
[]
> @@ -4191,7 +4191,7 @@ static ssize_t qm_qos_value_init(const char *buf, unsigned long *val)
>  			return -EINVAL;
>  	}
>  
> 
> -	ret = sscanf(buf, "%ld", val);
> +	ret = sscanf(buf, "%lu", val);
>  	if (ret != QM_QOS_VAL_NUM)
>  		return -EINVAL;

QM_QOS_VAL_NUM seems an especially silly define

A direct use of 1 would be _far_ better IMO.

$ git grep -w -n QM_QOS_VAL_NUM
drivers/crypto/hisilicon/qm.c:246:#define QM_QOS_VAL_NUM                        1
drivers/crypto/hisilicon/qm.c:4189:     if (ret != QM_QOS_VAL_NUM)


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ