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  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]
Date:   Fri, 10 Aug 2018 10:12:12 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Manish Chopra <manish.chopra@...ium.com>
Cc:     kbuild-all@...org, netdev@...r.kernel.org,
        Ariel Elior <ariel.elior@...ium.com>
Subject: [net-next:master 1941/1953]
 drivers/net/ethernet/qlogic/qede/qede_filter.c:2048:38: sparse: restricted
 __be16 degrades to integer

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   36d2f761b5aa688567b6aebdc6d68e73682275d4
commit: 2ce9c93eaca6c67e3fa8828a471738a32cd66770 [1941/1953] qede: Ingress tc flower offload (drop action) support.
reproduce:
        # apt-get install sparse
        git checkout 2ce9c93eaca6c67e3fa8828a471738a32cd66770
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/overflow.h:220:13: sparse: undefined identifier '__builtin_mul_overflow'
   include/linux/overflow.h:220:13: sparse: incorrect type in conditional
   include/linux/overflow.h:220:13:    got void
>> drivers/net/ethernet/qlogic/qede/qede_filter.c:2048:38: sparse: restricted __be16 degrades to integer
   drivers/net/ethernet/qlogic/qede/qede_filter.c:2049:38: sparse: restricted __be16 degrades to integer
>> drivers/net/ethernet/qlogic/qede/qede_filter.c:2115:38: sparse: restricted __be32 degrades to integer
   drivers/net/ethernet/qlogic/qede/qede_filter.c:2116:38: sparse: restricted __be32 degrades to integer
   include/linux/overflow.h:220:13: sparse: call with no type!

vim +2048 drivers/net/ethernet/qlogic/qede/qede_filter.c

  2032	
  2033	static int
  2034	qede_tc_parse_ports(struct qede_dev *edev,
  2035			    struct tc_cls_flower_offload *f,
  2036			    struct qede_arfs_tuple *t)
  2037	{
  2038		if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_PORTS)) {
  2039			struct flow_dissector_key_ports *key, *mask;
  2040	
  2041			key = skb_flow_dissector_target(f->dissector,
  2042							FLOW_DISSECTOR_KEY_PORTS,
  2043							f->key);
  2044			mask = skb_flow_dissector_target(f->dissector,
  2045							 FLOW_DISSECTOR_KEY_PORTS,
  2046							 f->mask);
  2047	
> 2048			if ((key->src && mask->src != U16_MAX) ||
  2049			    (key->dst && mask->dst != U16_MAX)) {
  2050				DP_NOTICE(edev, "Do not support ports masks\n");
  2051				return -EINVAL;
  2052			}
  2053	
  2054			t->src_port = key->src;
  2055			t->dst_port = key->dst;
  2056		}
  2057	
  2058		return 0;
  2059	}
  2060	
  2061	static int
  2062	qede_tc_parse_v6_common(struct qede_dev *edev,
  2063				struct tc_cls_flower_offload *f,
  2064				struct qede_arfs_tuple *t)
  2065	{
  2066		struct in6_addr zero_addr, addr;
  2067	
  2068		memset(&zero_addr, 0, sizeof(addr));
  2069		memset(&addr, 0xff, sizeof(addr));
  2070	
  2071		if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_IPV6_ADDRS)) {
  2072			struct flow_dissector_key_ipv6_addrs *key, *mask;
  2073	
  2074			key = skb_flow_dissector_target(f->dissector,
  2075							FLOW_DISSECTOR_KEY_IPV6_ADDRS,
  2076							f->key);
  2077			mask = skb_flow_dissector_target(f->dissector,
  2078							 FLOW_DISSECTOR_KEY_IPV6_ADDRS,
  2079							 f->mask);
  2080	
  2081			if ((memcmp(&key->src, &zero_addr, sizeof(addr)) &&
  2082			     memcmp(&mask->src, &addr, sizeof(addr))) ||
  2083			    (memcmp(&key->dst, &zero_addr, sizeof(addr)) &&
  2084			     memcmp(&mask->dst, &addr, sizeof(addr)))) {
  2085				DP_NOTICE(edev,
  2086					  "Do not support IPv6 address prefix/mask\n");
  2087				return -EINVAL;
  2088			}
  2089	
  2090			memcpy(&t->src_ipv6, &key->src, sizeof(addr));
  2091			memcpy(&t->dst_ipv6, &key->dst, sizeof(addr));
  2092		}
  2093	
  2094		if (qede_tc_parse_ports(edev, f, t))
  2095			return -EINVAL;
  2096	
  2097		return qede_set_v6_tuple_to_profile(edev, t, &zero_addr);
  2098	}
  2099	
  2100	static int
  2101	qede_tc_parse_v4_common(struct qede_dev *edev,
  2102				struct tc_cls_flower_offload *f,
  2103				struct qede_arfs_tuple *t)
  2104	{
  2105		if (dissector_uses_key(f->dissector, FLOW_DISSECTOR_KEY_IPV4_ADDRS)) {
  2106			struct flow_dissector_key_ipv4_addrs *key, *mask;
  2107	
  2108			key = skb_flow_dissector_target(f->dissector,
  2109							FLOW_DISSECTOR_KEY_IPV4_ADDRS,
  2110							f->key);
  2111			mask = skb_flow_dissector_target(f->dissector,
  2112							 FLOW_DISSECTOR_KEY_IPV4_ADDRS,
  2113							 f->mask);
  2114	
> 2115			if ((key->src && mask->src != U32_MAX) ||
  2116			    (key->dst && mask->dst != U32_MAX)) {
  2117				DP_NOTICE(edev, "Do not support ipv4 prefix/masks\n");
  2118				return -EINVAL;
  2119			}
  2120	
  2121			t->src_ipv4 = key->src;
  2122			t->dst_ipv4 = key->dst;
  2123		}
  2124	
  2125		if (qede_tc_parse_ports(edev, f, t))
  2126			return -EINVAL;
  2127	
  2128		return qede_set_v4_tuple_to_profile(edev, t);
  2129	}
  2130	

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

Powered by blists - more mailing lists