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>] [day] [month] [year] [list]
Message-ID: <202211282320.gpKpokRx-lkp@intel.com>
Date:   Mon, 28 Nov 2022 23:57:56 +0800
From:   kernel test robot <lkp@...el.com>
To:     Masahiro Yamada <masahiroy@...nel.org>
Cc:     oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1183:13:
 sparse: sparse: restricted __be64 degrades to integer

Hi Masahiro,

First bad commit (maybe != root cause):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b7b275e60bcd5f89771e865a8239325f86d9927d
commit: 3753af778dd9d0d5199d6a7d01b0ead33135d095 kbuild: fix single directory build
date:   6 weeks ago
config: loongarch-randconfig-s041-20221128
compiler: loongarch64-linux-gcc (GCC) 12.1.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3753af778dd9d0d5199d6a7d01b0ead33135d095
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 3753af778dd9d0d5199d6a7d01b0ead33135d095
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=loongarch SHELL=/bin/bash drivers/net/ethernet/mellanox/mlx5/core/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c:1183:13: sparse: sparse: restricted __be64 degrades to integer

vim +1183 drivers/net/ethernet/mellanox/mlx5/core/en_accel/macsec_fs.c

3b20949cb21bac Lior Nahmanson    2022-09-05  1105  
3b20949cb21bac Lior Nahmanson    2022-09-05  1106  static union mlx5e_macsec_rule *
3b20949cb21bac Lior Nahmanson    2022-09-05  1107  macsec_fs_rx_add_rule(struct mlx5e_macsec_fs *macsec_fs,
e467b283ffd50c Lior Nahmanson    2022-09-05  1108  		      const struct macsec_context *macsec_ctx,
9515978eee0b93 Lior Nahmanson    2022-09-05  1109  		      struct mlx5_macsec_rule_attrs *attrs,
3b20949cb21bac Lior Nahmanson    2022-09-05  1110  		      u32 fs_id)
e467b283ffd50c Lior Nahmanson    2022-09-05  1111  {
3b20949cb21bac Lior Nahmanson    2022-09-05  1112  	u8 action[MLX5_UN_SZ_BYTES(set_add_copy_action_in_auto)] = {};
3b20949cb21bac Lior Nahmanson    2022-09-05  1113  	struct mlx5e_macsec_rx *rx_fs = macsec_fs->rx_fs;
3b20949cb21bac Lior Nahmanson    2022-09-05  1114  	struct net_device *netdev = macsec_fs->netdev;
2e50e9bf328fb7 Nathan Chancellor 2022-09-11  1115  	union mlx5e_macsec_rule *macsec_rule = NULL;
3b20949cb21bac Lior Nahmanson    2022-09-05  1116  	struct mlx5_modify_hdr *modify_hdr = NULL;
3b20949cb21bac Lior Nahmanson    2022-09-05  1117  	struct mlx5_flow_destination dest = {};
3b20949cb21bac Lior Nahmanson    2022-09-05  1118  	struct mlx5e_macsec_tables *rx_tables;
3b20949cb21bac Lior Nahmanson    2022-09-05  1119  	struct mlx5e_macsec_rx_rule *rx_rule;
3b20949cb21bac Lior Nahmanson    2022-09-05  1120  	struct mlx5_flow_act flow_act = {};
3b20949cb21bac Lior Nahmanson    2022-09-05  1121  	struct mlx5e_flow_table *ft_crypto;
3b20949cb21bac Lior Nahmanson    2022-09-05  1122  	struct mlx5_flow_handle *rule;
3b20949cb21bac Lior Nahmanson    2022-09-05  1123  	struct mlx5_flow_spec *spec;
3b20949cb21bac Lior Nahmanson    2022-09-05  1124  	int err = 0;
e467b283ffd50c Lior Nahmanson    2022-09-05  1125  
3b20949cb21bac Lior Nahmanson    2022-09-05  1126  	spec = kvzalloc(sizeof(*spec), GFP_KERNEL);
3b20949cb21bac Lior Nahmanson    2022-09-05  1127  	if (!spec)
e467b283ffd50c Lior Nahmanson    2022-09-05  1128  		return NULL;
3b20949cb21bac Lior Nahmanson    2022-09-05  1129  
3b20949cb21bac Lior Nahmanson    2022-09-05  1130  	err = macsec_fs_rx_ft_get(macsec_fs);
3b20949cb21bac Lior Nahmanson    2022-09-05  1131  	if (err)
3b20949cb21bac Lior Nahmanson    2022-09-05  1132  		goto out_spec;
3b20949cb21bac Lior Nahmanson    2022-09-05  1133  
3b20949cb21bac Lior Nahmanson    2022-09-05  1134  	macsec_rule = kzalloc(sizeof(*macsec_rule), GFP_KERNEL);
3b20949cb21bac Lior Nahmanson    2022-09-05  1135  	if (!macsec_rule) {
3b20949cb21bac Lior Nahmanson    2022-09-05  1136  		macsec_fs_rx_ft_put(macsec_fs);
3b20949cb21bac Lior Nahmanson    2022-09-05  1137  		goto out_spec;
3b20949cb21bac Lior Nahmanson    2022-09-05  1138  	}
3b20949cb21bac Lior Nahmanson    2022-09-05  1139  
3b20949cb21bac Lior Nahmanson    2022-09-05  1140  	rx_rule = &macsec_rule->rx_rule;
3b20949cb21bac Lior Nahmanson    2022-09-05  1141  	rx_tables = &rx_fs->tables;
3b20949cb21bac Lior Nahmanson    2022-09-05  1142  	ft_crypto = &rx_tables->ft_crypto;
3b20949cb21bac Lior Nahmanson    2022-09-05  1143  
3b20949cb21bac Lior Nahmanson    2022-09-05  1144  	/* Set bit[31 - 30] macsec marker - 0x01 */
3b20949cb21bac Lior Nahmanson    2022-09-05  1145  	/* Set bit[3-0] fs id */
3b20949cb21bac Lior Nahmanson    2022-09-05  1146  	MLX5_SET(set_action_in, action, action_type, MLX5_ACTION_TYPE_SET);
3b20949cb21bac Lior Nahmanson    2022-09-05  1147  	MLX5_SET(set_action_in, action, field, MLX5_ACTION_IN_FIELD_METADATA_REG_B);
3b20949cb21bac Lior Nahmanson    2022-09-05  1148  	MLX5_SET(set_action_in, action, data, fs_id | BIT(30));
3b20949cb21bac Lior Nahmanson    2022-09-05  1149  	MLX5_SET(set_action_in, action, offset, 0);
3b20949cb21bac Lior Nahmanson    2022-09-05  1150  	MLX5_SET(set_action_in, action, length, 32);
3b20949cb21bac Lior Nahmanson    2022-09-05  1151  
3b20949cb21bac Lior Nahmanson    2022-09-05  1152  	modify_hdr = mlx5_modify_header_alloc(macsec_fs->mdev, MLX5_FLOW_NAMESPACE_KERNEL_RX_MACSEC,
3b20949cb21bac Lior Nahmanson    2022-09-05  1153  					      1, action);
3b20949cb21bac Lior Nahmanson    2022-09-05  1154  	if (IS_ERR(modify_hdr)) {
3b20949cb21bac Lior Nahmanson    2022-09-05  1155  		err = PTR_ERR(modify_hdr);
3b20949cb21bac Lior Nahmanson    2022-09-05  1156  		netdev_err(netdev, "fail to alloc MACsec set modify_header_id err=%d\n", err);
3b20949cb21bac Lior Nahmanson    2022-09-05  1157  		modify_hdr = NULL;
3b20949cb21bac Lior Nahmanson    2022-09-05  1158  		goto err;
3b20949cb21bac Lior Nahmanson    2022-09-05  1159  	}
3b20949cb21bac Lior Nahmanson    2022-09-05  1160  	rx_rule->meta_modhdr = modify_hdr;
3b20949cb21bac Lior Nahmanson    2022-09-05  1161  
3b20949cb21bac Lior Nahmanson    2022-09-05  1162  	/* Rx crypto table with SCI rule */
3b20949cb21bac Lior Nahmanson    2022-09-05  1163  	macsec_fs_rx_setup_fte(spec, &flow_act, attrs, true);
3b20949cb21bac Lior Nahmanson    2022-09-05  1164  
3b20949cb21bac Lior Nahmanson    2022-09-05  1165  	flow_act.modify_hdr = modify_hdr;
3b20949cb21bac Lior Nahmanson    2022-09-05  1166  	flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
3b20949cb21bac Lior Nahmanson    2022-09-05  1167  			  MLX5_FLOW_CONTEXT_ACTION_CRYPTO_DECRYPT |
3b20949cb21bac Lior Nahmanson    2022-09-05  1168  			  MLX5_FLOW_CONTEXT_ACTION_MOD_HDR;
3b20949cb21bac Lior Nahmanson    2022-09-05  1169  
3b20949cb21bac Lior Nahmanson    2022-09-05  1170  	dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
3b20949cb21bac Lior Nahmanson    2022-09-05  1171  	dest.ft = rx_tables->ft_check;
3b20949cb21bac Lior Nahmanson    2022-09-05  1172  	rule = mlx5_add_flow_rules(ft_crypto->t, spec, &flow_act, &dest, 1);
3b20949cb21bac Lior Nahmanson    2022-09-05  1173  	if (IS_ERR(rule)) {
3b20949cb21bac Lior Nahmanson    2022-09-05  1174  		err = PTR_ERR(rule);
3b20949cb21bac Lior Nahmanson    2022-09-05  1175  		netdev_err(netdev,
3b20949cb21bac Lior Nahmanson    2022-09-05  1176  			   "Failed to add SA with SCI rule to Rx crypto rule, err=%d\n",
3b20949cb21bac Lior Nahmanson    2022-09-05  1177  			   err);
3b20949cb21bac Lior Nahmanson    2022-09-05  1178  		goto err;
3b20949cb21bac Lior Nahmanson    2022-09-05  1179  	}
3b20949cb21bac Lior Nahmanson    2022-09-05  1180  	rx_rule->rule[0] = rule;
3b20949cb21bac Lior Nahmanson    2022-09-05  1181  
3b20949cb21bac Lior Nahmanson    2022-09-05  1182  	/* Rx crypto table without SCI rule */
3b20949cb21bac Lior Nahmanson    2022-09-05 @1183  	if (cpu_to_be64((__force u64)attrs->sci) & ntohs(MACSEC_PORT_ES)) {
3b20949cb21bac Lior Nahmanson    2022-09-05  1184  		memset(spec, 0, sizeof(struct mlx5_flow_spec));
3b20949cb21bac Lior Nahmanson    2022-09-05  1185  		memset(&dest, 0, sizeof(struct mlx5_flow_destination));
3b20949cb21bac Lior Nahmanson    2022-09-05  1186  		memset(&flow_act, 0, sizeof(flow_act));
3b20949cb21bac Lior Nahmanson    2022-09-05  1187  
3b20949cb21bac Lior Nahmanson    2022-09-05  1188  		macsec_fs_rx_setup_fte(spec, &flow_act, attrs, false);
3b20949cb21bac Lior Nahmanson    2022-09-05  1189  
3b20949cb21bac Lior Nahmanson    2022-09-05  1190  		flow_act.modify_hdr = modify_hdr;
3b20949cb21bac Lior Nahmanson    2022-09-05  1191  		flow_act.action = MLX5_FLOW_CONTEXT_ACTION_FWD_DEST |
3b20949cb21bac Lior Nahmanson    2022-09-05  1192  				  MLX5_FLOW_CONTEXT_ACTION_CRYPTO_DECRYPT |
3b20949cb21bac Lior Nahmanson    2022-09-05  1193  				  MLX5_FLOW_CONTEXT_ACTION_MOD_HDR;
3b20949cb21bac Lior Nahmanson    2022-09-05  1194  
3b20949cb21bac Lior Nahmanson    2022-09-05  1195  		dest.type = MLX5_FLOW_DESTINATION_TYPE_FLOW_TABLE;
3b20949cb21bac Lior Nahmanson    2022-09-05  1196  		dest.ft = rx_tables->ft_check;
3b20949cb21bac Lior Nahmanson    2022-09-05  1197  		rule = mlx5_add_flow_rules(ft_crypto->t, spec, &flow_act, &dest, 1);
3b20949cb21bac Lior Nahmanson    2022-09-05  1198  		if (IS_ERR(rule)) {
3b20949cb21bac Lior Nahmanson    2022-09-05  1199  			err = PTR_ERR(rule);
3b20949cb21bac Lior Nahmanson    2022-09-05  1200  			netdev_err(netdev,
3b20949cb21bac Lior Nahmanson    2022-09-05  1201  				   "Failed to add SA without SCI rule to Rx crypto rule, err=%d\n",
3b20949cb21bac Lior Nahmanson    2022-09-05  1202  				   err);
3b20949cb21bac Lior Nahmanson    2022-09-05  1203  			goto err;
3b20949cb21bac Lior Nahmanson    2022-09-05  1204  		}
3b20949cb21bac Lior Nahmanson    2022-09-05  1205  		rx_rule->rule[1] = rule;
3b20949cb21bac Lior Nahmanson    2022-09-05  1206  	}
3b20949cb21bac Lior Nahmanson    2022-09-05  1207  
3b20949cb21bac Lior Nahmanson    2022-09-05  1208  	return macsec_rule;
3b20949cb21bac Lior Nahmanson    2022-09-05  1209  
3b20949cb21bac Lior Nahmanson    2022-09-05  1210  err:
3b20949cb21bac Lior Nahmanson    2022-09-05  1211  	macsec_fs_rx_del_rule(macsec_fs, rx_rule);
3b20949cb21bac Lior Nahmanson    2022-09-05  1212  	macsec_rule = NULL;
3b20949cb21bac Lior Nahmanson    2022-09-05  1213  out_spec:
3b20949cb21bac Lior Nahmanson    2022-09-05  1214  	kvfree(spec);
3b20949cb21bac Lior Nahmanson    2022-09-05  1215  	return macsec_rule;
3b20949cb21bac Lior Nahmanson    2022-09-05  1216  }
3b20949cb21bac Lior Nahmanson    2022-09-05  1217  

:::::: The code at line 1183 was first introduced by commit
:::::: 3b20949cb21bac26d50cdcc58896802a890cfe15 net/mlx5e: Add MACsec RX steering rules

:::::: TO: Lior Nahmanson <liorna@...dia.com>
:::::: CC: David S. Miller <davem@...emloft.net>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (157462 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ