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>] [day] [month] [year] [list]
Message-ID: <20200911175144.GJ12635@kadam>
Date:   Fri, 11 Sep 2020 20:51:44 +0300
From:   Dan Carpenter <dan.carpenter@...cle.com>
To:     kbuild@...ts.01.org, Aya Levin <ayal@...lanox.com>
Cc:     lkp@...el.com, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org, Saeed Mahameed <saeedm@...lanox.com>,
        Eran Ben Elisha <eranbe@...lanox.com>
Subject: drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453
 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   581cb3a26baf846ee9636214afaa5333919875b1
commit: 2132b71f78d207b63974fc7d6eced9c5e886c405 net/mlx5e: Advertise globaly supported FEC modes
config: powerpc-randconfig-m031-20200911 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>

New smatch warnings:
drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'

# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2132b71f78d207b63974fc7d6eced9c5e886c405
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 2132b71f78d207b63974fc7d6eced9c5e886c405
vim +453 drivers/net/ethernet/mellanox/mlx5/core/en/port.c

2132b71f78d207 Aya Levin     2020-02-11  444  bool mlx5e_fec_in_caps(struct mlx5_core_dev *dev, int fec_policy)
                                              ^^^^

2095b264147753 Shay Agroskin 2018-10-10  445  {
2095b264147753 Shay Agroskin 2018-10-10  446  	u32 out[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  447  	u32 in[MLX5_ST_SZ_DW(pplm_reg)] = {};
2095b264147753 Shay Agroskin 2018-10-10  448  	int sz = MLX5_ST_SZ_BYTES(pplm_reg);
2095b264147753 Shay Agroskin 2018-10-10  449  	int err;
2132b71f78d207 Aya Levin     2020-02-11  450  	int i;
2095b264147753 Shay Agroskin 2018-10-10  451  
2095b264147753 Shay Agroskin 2018-10-10  452  	if (!MLX5_CAP_GEN(dev, pcam_reg))
2095b264147753 Shay Agroskin 2018-10-10 @453  		return -EOPNOTSUPP;
                                                        ^^^^^^^^^^^^^^^^^^

2095b264147753 Shay Agroskin 2018-10-10  454  
2095b264147753 Shay Agroskin 2018-10-10  455  	if (!MLX5_CAP_PCAM_REG(dev, pplm))
2095b264147753 Shay Agroskin 2018-10-10  456  		return -EOPNOTSUPP;
                                                        ^^^^^^^^^^^^^^^^^^
These become "return true;"

2095b264147753 Shay Agroskin 2018-10-10  457  
2095b264147753 Shay Agroskin 2018-10-10  458  	MLX5_SET(pplm_reg, in, local_port, 1);
2095b264147753 Shay Agroskin 2018-10-10  459  	err =  mlx5_core_access_reg(dev, in, sz, out, sz, MLX5_REG_PPLM, 0, 0);
2095b264147753 Shay Agroskin 2018-10-10  460  	if (err)
2132b71f78d207 Aya Levin     2020-02-11  461  		return false;
2095b264147753 Shay Agroskin 2018-10-10  462  
2132b71f78d207 Aya Levin     2020-02-11  463  	for (i = 0; i < MLX5E_FEC_SUPPORTED_SPEEDS; i++) {
2132b71f78d207 Aya Levin     2020-02-11  464  		u8 fec_caps;
2095b264147753 Shay Agroskin 2018-10-10  465  
2132b71f78d207 Aya Levin     2020-02-11  466  		mlx5e_get_fec_cap_field(out, &fec_caps, fec_supported_speeds[i]);
2132b71f78d207 Aya Levin     2020-02-11  467  		if (fec_caps & fec_policy)
2132b71f78d207 Aya Levin     2020-02-11  468  			return true;
2132b71f78d207 Aya Levin     2020-02-11  469  	}
2132b71f78d207 Aya Levin     2020-02-11  470  	return false;
2095b264147753 Shay Agroskin 2018-10-10  471  }

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

Download attachment ".config.gz" of type "application/gzip" (34773 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ