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] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 16 Aug 2021 10:48:20 +0000
From:   "Kumar, M Chetan" <m.chetan.kumar@...el.com>
To:     Dan Carpenter <dan.carpenter@...cle.com>,
        Solomon Ucko <solly.ucko@...il.com>
CC:     linuxwwan <linuxwwan@...el.com>,
        Loic Poulain <loic.poulain@...aro.org>,
        Sergey Ryazanov <ryazanov.s.a@...il.com>,
        Johannes Berg <johannes@...solutions.net>,
        "David S. Miller" <davem@...emloft.net>,
        "Jakub Kicinski" <kuba@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "security@...nel.org" <security@...nel.org>
Subject: RE: [PATCH net] net: iosm: Prevent underflow in ipc_chnl_cfg_get()

Hi Dan,

> +++ b/drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c
> @@ -64,10 +64,9 @@ static struct ipc_chnl_cfg modem_cfg[] = {
> 
>  int ipc_chnl_cfg_get(struct ipc_chnl_cfg *chnl_cfg, int index)  {
> -	int array_size = ARRAY_SIZE(modem_cfg);
> -
> -	if (index >= array_size) {
> -		pr_err("index: %d and array_size %d", index, array_size);
> +	if (index >= ARRAY_SIZE(modem_cfg)) {
> +		pr_err("index: %d and array_size %lu", index,

array_size is removed so please change array_size in pr_err to array size (remove _).

Also change in pr_err array size format "%lu" is throwing warning [1] in 32bit env.

[1]
                 from ../drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c:6:
../drivers/net/wwan/iosm/iosm_ipc_chnl_cfg.c: In function 'ipc_chnl_cfg_get':
../include/linux/kern_levels.h:5:18: warning: format '%lu' expects argument of type
 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]

Regards,
Chetan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ