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]
Message-ID: <201806302028.1bRro3sO%fengguang.wu@intel.com>
Date:   Sat, 30 Jun 2018 20:54:20 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Jianbo Liu <jianbol@...lanox.com>
Cc:     kbuild-all@...org, netdev@...r.kernel.org, davem@...emloft.net,
        jiri@...nulli.us, Jianbo Liu <jianbol@...lanox.com>,
        Jamal Hadi Salim <jhs@...atatu.com>,
        Cong Wang <xiyou.wangcong@...il.com>
Subject: Re: [PATCH net-next 4/5] net/sched: flower: Dump the ethertype
 encapsulated in vlan

Hi Jianbo,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net-next/master]

url:    https://github.com/0day-ci/linux/commits/Jianbo-Liu/net-flow_dissector-Save-vlan-ethertype-from-headers/20180630-180158
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   net/sched/cls_flower.c:544:15: sparse: cast to restricted __be32
   net/sched/cls_flower.c:544:15: sparse: cast to restricted __be32
   net/sched/cls_flower.c:544:15: sparse: cast to restricted __be32
   net/sched/cls_flower.c:544:15: sparse: cast to restricted __be32
   net/sched/cls_flower.c:544:15: sparse: cast to restricted __be32
   net/sched/cls_flower.c:544:15: sparse: cast to restricted __be32
   net/sched/cls_flower.c:545:16: sparse: cast to restricted __be32
   net/sched/cls_flower.c:545:16: sparse: cast to restricted __be32
   net/sched/cls_flower.c:545:16: sparse: cast to restricted __be32
   net/sched/cls_flower.c:545:16: sparse: cast to restricted __be32
   net/sched/cls_flower.c:545:16: sparse: cast to restricted __be32
   net/sched/cls_flower.c:545:16: sparse: cast to restricted __be32
   include/linux/slab.h:631:13: sparse: undefined identifier '__builtin_mul_overflow'
   include/linux/slab.h:631:13: sparse: not a function <noident>
>> net/sched/cls_flower.c:1317:70: sparse: incorrect type in argument 3 (different base types) @@    expected unsigned short [unsigned] [usertype] value @@    got  short [unsigned] [usertype] value @@
   net/sched/cls_flower.c:1317:70:    expected unsigned short [unsigned] [usertype] value
   net/sched/cls_flower.c:1317:70:    got restricted __be16 [usertype] n_proto
   include/linux/slab.h:631:13: sparse: call with no type!

vim +1317 net/sched/cls_flower.c

  1264	
  1265	static int fl_dump(struct net *net, struct tcf_proto *tp, void *fh,
  1266			   struct sk_buff *skb, struct tcmsg *t)
  1267	{
  1268		struct cls_fl_filter *f = fh;
  1269		struct nlattr *nest;
  1270		struct fl_flow_key *key, *mask;
  1271	
  1272		if (!f)
  1273			return skb->len;
  1274	
  1275		t->tcm_handle = f->handle;
  1276	
  1277		nest = nla_nest_start(skb, TCA_OPTIONS);
  1278		if (!nest)
  1279			goto nla_put_failure;
  1280	
  1281		if (f->res.classid &&
  1282		    nla_put_u32(skb, TCA_FLOWER_CLASSID, f->res.classid))
  1283			goto nla_put_failure;
  1284	
  1285		key = &f->key;
  1286		mask = &f->mask->key;
  1287	
  1288		if (mask->indev_ifindex) {
  1289			struct net_device *dev;
  1290	
  1291			dev = __dev_get_by_index(net, key->indev_ifindex);
  1292			if (dev && nla_put_string(skb, TCA_FLOWER_INDEV, dev->name))
  1293				goto nla_put_failure;
  1294		}
  1295	
  1296		if (!tc_skip_hw(f->flags))
  1297			fl_hw_update_stats(tp, f);
  1298	
  1299		if (fl_dump_key_val(skb, key->eth.dst, TCA_FLOWER_KEY_ETH_DST,
  1300				    mask->eth.dst, TCA_FLOWER_KEY_ETH_DST_MASK,
  1301				    sizeof(key->eth.dst)) ||
  1302		    fl_dump_key_val(skb, key->eth.src, TCA_FLOWER_KEY_ETH_SRC,
  1303				    mask->eth.src, TCA_FLOWER_KEY_ETH_SRC_MASK,
  1304				    sizeof(key->eth.src)) ||
  1305		    fl_dump_key_val(skb, &key->basic.n_proto, TCA_FLOWER_KEY_ETH_TYPE,
  1306				    &mask->basic.n_proto, TCA_FLOWER_UNSPEC,
  1307				    sizeof(key->basic.n_proto)))
  1308			goto nla_put_failure;
  1309	
  1310		if (fl_dump_key_mpls(skb, &key->mpls, &mask->mpls))
  1311			goto nla_put_failure;
  1312	
  1313		if (fl_dump_key_vlan(skb, &key->vlan, &mask->vlan))
  1314			goto nla_put_failure;
  1315	
  1316		if (mask->vlan.vlan_tpid &&
> 1317		    nla_put_u16(skb, TCA_FLOWER_KEY_VLAN_ETH_TYPE, key->basic.n_proto))
  1318			goto nla_put_failure;
  1319	
  1320		if ((key->basic.n_proto == htons(ETH_P_IP) ||
  1321		     key->basic.n_proto == htons(ETH_P_IPV6)) &&
  1322		    (fl_dump_key_val(skb, &key->basic.ip_proto, TCA_FLOWER_KEY_IP_PROTO,
  1323				    &mask->basic.ip_proto, TCA_FLOWER_UNSPEC,
  1324				    sizeof(key->basic.ip_proto)) ||
  1325		    fl_dump_key_ip(skb, &key->ip, &mask->ip)))
  1326			goto nla_put_failure;
  1327	
  1328		if (key->control.addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS &&
  1329		    (fl_dump_key_val(skb, &key->ipv4.src, TCA_FLOWER_KEY_IPV4_SRC,
  1330				     &mask->ipv4.src, TCA_FLOWER_KEY_IPV4_SRC_MASK,
  1331				     sizeof(key->ipv4.src)) ||
  1332		     fl_dump_key_val(skb, &key->ipv4.dst, TCA_FLOWER_KEY_IPV4_DST,
  1333				     &mask->ipv4.dst, TCA_FLOWER_KEY_IPV4_DST_MASK,
  1334				     sizeof(key->ipv4.dst))))
  1335			goto nla_put_failure;
  1336		else if (key->control.addr_type == FLOW_DISSECTOR_KEY_IPV6_ADDRS &&
  1337			 (fl_dump_key_val(skb, &key->ipv6.src, TCA_FLOWER_KEY_IPV6_SRC,
  1338					  &mask->ipv6.src, TCA_FLOWER_KEY_IPV6_SRC_MASK,
  1339					  sizeof(key->ipv6.src)) ||
  1340			  fl_dump_key_val(skb, &key->ipv6.dst, TCA_FLOWER_KEY_IPV6_DST,
  1341					  &mask->ipv6.dst, TCA_FLOWER_KEY_IPV6_DST_MASK,
  1342					  sizeof(key->ipv6.dst))))
  1343			goto nla_put_failure;
  1344	
  1345		if (key->basic.ip_proto == IPPROTO_TCP &&
  1346		    (fl_dump_key_val(skb, &key->tp.src, TCA_FLOWER_KEY_TCP_SRC,
  1347				     &mask->tp.src, TCA_FLOWER_KEY_TCP_SRC_MASK,
  1348				     sizeof(key->tp.src)) ||
  1349		     fl_dump_key_val(skb, &key->tp.dst, TCA_FLOWER_KEY_TCP_DST,
  1350				     &mask->tp.dst, TCA_FLOWER_KEY_TCP_DST_MASK,
  1351				     sizeof(key->tp.dst)) ||
  1352		     fl_dump_key_val(skb, &key->tcp.flags, TCA_FLOWER_KEY_TCP_FLAGS,
  1353				     &mask->tcp.flags, TCA_FLOWER_KEY_TCP_FLAGS_MASK,
  1354				     sizeof(key->tcp.flags))))
  1355			goto nla_put_failure;
  1356		else if (key->basic.ip_proto == IPPROTO_UDP &&
  1357			 (fl_dump_key_val(skb, &key->tp.src, TCA_FLOWER_KEY_UDP_SRC,
  1358					  &mask->tp.src, TCA_FLOWER_KEY_UDP_SRC_MASK,
  1359					  sizeof(key->tp.src)) ||
  1360			  fl_dump_key_val(skb, &key->tp.dst, TCA_FLOWER_KEY_UDP_DST,
  1361					  &mask->tp.dst, TCA_FLOWER_KEY_UDP_DST_MASK,
  1362					  sizeof(key->tp.dst))))
  1363			goto nla_put_failure;
  1364		else if (key->basic.ip_proto == IPPROTO_SCTP &&
  1365			 (fl_dump_key_val(skb, &key->tp.src, TCA_FLOWER_KEY_SCTP_SRC,
  1366					  &mask->tp.src, TCA_FLOWER_KEY_SCTP_SRC_MASK,
  1367					  sizeof(key->tp.src)) ||
  1368			  fl_dump_key_val(skb, &key->tp.dst, TCA_FLOWER_KEY_SCTP_DST,
  1369					  &mask->tp.dst, TCA_FLOWER_KEY_SCTP_DST_MASK,
  1370					  sizeof(key->tp.dst))))
  1371			goto nla_put_failure;
  1372		else if (key->basic.n_proto == htons(ETH_P_IP) &&
  1373			 key->basic.ip_proto == IPPROTO_ICMP &&
  1374			 (fl_dump_key_val(skb, &key->icmp.type,
  1375					  TCA_FLOWER_KEY_ICMPV4_TYPE, &mask->icmp.type,
  1376					  TCA_FLOWER_KEY_ICMPV4_TYPE_MASK,
  1377					  sizeof(key->icmp.type)) ||
  1378			  fl_dump_key_val(skb, &key->icmp.code,
  1379					  TCA_FLOWER_KEY_ICMPV4_CODE, &mask->icmp.code,
  1380					  TCA_FLOWER_KEY_ICMPV4_CODE_MASK,
  1381					  sizeof(key->icmp.code))))
  1382			goto nla_put_failure;
  1383		else if (key->basic.n_proto == htons(ETH_P_IPV6) &&
  1384			 key->basic.ip_proto == IPPROTO_ICMPV6 &&
  1385			 (fl_dump_key_val(skb, &key->icmp.type,
  1386					  TCA_FLOWER_KEY_ICMPV6_TYPE, &mask->icmp.type,
  1387					  TCA_FLOWER_KEY_ICMPV6_TYPE_MASK,
  1388					  sizeof(key->icmp.type)) ||
  1389			  fl_dump_key_val(skb, &key->icmp.code,
  1390					  TCA_FLOWER_KEY_ICMPV6_CODE, &mask->icmp.code,
  1391					  TCA_FLOWER_KEY_ICMPV6_CODE_MASK,
  1392					  sizeof(key->icmp.code))))
  1393			goto nla_put_failure;
  1394		else if ((key->basic.n_proto == htons(ETH_P_ARP) ||
  1395			  key->basic.n_proto == htons(ETH_P_RARP)) &&
  1396			 (fl_dump_key_val(skb, &key->arp.sip,
  1397					  TCA_FLOWER_KEY_ARP_SIP, &mask->arp.sip,
  1398					  TCA_FLOWER_KEY_ARP_SIP_MASK,
  1399					  sizeof(key->arp.sip)) ||
  1400			  fl_dump_key_val(skb, &key->arp.tip,
  1401					  TCA_FLOWER_KEY_ARP_TIP, &mask->arp.tip,
  1402					  TCA_FLOWER_KEY_ARP_TIP_MASK,
  1403					  sizeof(key->arp.tip)) ||
  1404			  fl_dump_key_val(skb, &key->arp.op,
  1405					  TCA_FLOWER_KEY_ARP_OP, &mask->arp.op,
  1406					  TCA_FLOWER_KEY_ARP_OP_MASK,
  1407					  sizeof(key->arp.op)) ||
  1408			  fl_dump_key_val(skb, key->arp.sha, TCA_FLOWER_KEY_ARP_SHA,
  1409					  mask->arp.sha, TCA_FLOWER_KEY_ARP_SHA_MASK,
  1410					  sizeof(key->arp.sha)) ||
  1411			  fl_dump_key_val(skb, key->arp.tha, TCA_FLOWER_KEY_ARP_THA,
  1412					  mask->arp.tha, TCA_FLOWER_KEY_ARP_THA_MASK,
  1413					  sizeof(key->arp.tha))))
  1414			goto nla_put_failure;
  1415	
  1416		if (key->enc_control.addr_type == FLOW_DISSECTOR_KEY_IPV4_ADDRS &&
  1417		    (fl_dump_key_val(skb, &key->enc_ipv4.src,
  1418				    TCA_FLOWER_KEY_ENC_IPV4_SRC, &mask->enc_ipv4.src,
  1419				    TCA_FLOWER_KEY_ENC_IPV4_SRC_MASK,
  1420				    sizeof(key->enc_ipv4.src)) ||
  1421		     fl_dump_key_val(skb, &key->enc_ipv4.dst,
  1422				     TCA_FLOWER_KEY_ENC_IPV4_DST, &mask->enc_ipv4.dst,
  1423				     TCA_FLOWER_KEY_ENC_IPV4_DST_MASK,
  1424				     sizeof(key->enc_ipv4.dst))))
  1425			goto nla_put_failure;
  1426		else if (key->enc_control.addr_type == FLOW_DISSECTOR_KEY_IPV6_ADDRS &&
  1427			 (fl_dump_key_val(skb, &key->enc_ipv6.src,
  1428				    TCA_FLOWER_KEY_ENC_IPV6_SRC, &mask->enc_ipv6.src,
  1429				    TCA_FLOWER_KEY_ENC_IPV6_SRC_MASK,
  1430				    sizeof(key->enc_ipv6.src)) ||
  1431			 fl_dump_key_val(skb, &key->enc_ipv6.dst,
  1432					 TCA_FLOWER_KEY_ENC_IPV6_DST,
  1433					 &mask->enc_ipv6.dst,
  1434					 TCA_FLOWER_KEY_ENC_IPV6_DST_MASK,
  1435				    sizeof(key->enc_ipv6.dst))))
  1436			goto nla_put_failure;
  1437	
  1438		if (fl_dump_key_val(skb, &key->enc_key_id, TCA_FLOWER_KEY_ENC_KEY_ID,
  1439				    &mask->enc_key_id, TCA_FLOWER_UNSPEC,
  1440				    sizeof(key->enc_key_id)) ||
  1441		    fl_dump_key_val(skb, &key->enc_tp.src,
  1442				    TCA_FLOWER_KEY_ENC_UDP_SRC_PORT,
  1443				    &mask->enc_tp.src,
  1444				    TCA_FLOWER_KEY_ENC_UDP_SRC_PORT_MASK,
  1445				    sizeof(key->enc_tp.src)) ||
  1446		    fl_dump_key_val(skb, &key->enc_tp.dst,
  1447				    TCA_FLOWER_KEY_ENC_UDP_DST_PORT,
  1448				    &mask->enc_tp.dst,
  1449				    TCA_FLOWER_KEY_ENC_UDP_DST_PORT_MASK,
  1450				    sizeof(key->enc_tp.dst)))
  1451			goto nla_put_failure;
  1452	
  1453		if (fl_dump_key_flags(skb, key->control.flags, mask->control.flags))
  1454			goto nla_put_failure;
  1455	
  1456		if (f->flags && nla_put_u32(skb, TCA_FLOWER_FLAGS, f->flags))
  1457			goto nla_put_failure;
  1458	
  1459		if (tcf_exts_dump(skb, &f->exts))
  1460			goto nla_put_failure;
  1461	
  1462		nla_nest_end(skb, nest);
  1463	
  1464		if (tcf_exts_dump_stats(skb, &f->exts) < 0)
  1465			goto nla_put_failure;
  1466	
  1467		return skb->len;
  1468	
  1469	nla_put_failure:
  1470		nla_nest_cancel(skb, nest);
  1471		return -1;
  1472	}
  1473	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ