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: <202111091903.szcR5o5V-lkp@intel.com>
Date:   Tue, 9 Nov 2021 19:40:13 +0800
From:   kernel test robot <lkp@...el.com>
To:     Kris Van Hees <kris.van.hees@...cle.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Nick Alcock <nick.alcock@...cle.com>,
        Tomas Jedlicka <tomas.jedlicka@...cle.com>,
        Eugene Loh <eugene.loh@...cle.com>,
        Alan Maguire <alan.maguire@...cle.com>,
        David Mc Lean <david.mclean@...cle.com>,
        Vincent Lim <vincent.lim@...cle.com>
Subject: [oracle-dtrace:v1/5.15 30/35] net/ipv6/ip6_output.c:69:21: warning:
 variable 'dropreason' set but not used

tree:   https://github.com/oracle/dtrace-linux-kernel v1/5.15
head:   0fee66d7ce96317146609675767971d0f35c3e74
commit: 7ed2333cfd691c676b0adfe951d92244f1ef5128 [30/35] dtrace: add SDT probes
config: csky-defconfig (attached as .config)
compiler: csky-linux-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/oracle/dtrace-linux-kernel/commit/7ed2333cfd691c676b0adfe951d92244f1ef5128
        git remote add oracle-dtrace https://github.com/oracle/dtrace-linux-kernel
        git fetch --no-tags oracle-dtrace v1/5.15
        git checkout 7ed2333cfd691c676b0adfe951d92244f1ef5128
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=csky 

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

All warnings (new ones prefixed by >>):

   net/ipv6/ip6_output.c: In function 'ip6_finish_output2':
>> net/ipv6/ip6_output.c:69:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
      69 |         const char *dropreason;
         |                     ^~~~~~~~~~
   net/ipv6/ip6_output.c: In function 'ip6_xmit':
   net/ipv6/ip6_output.c:291:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
     291 |         const char *dropreason;
         |                     ^~~~~~~~~~
   net/ipv6/ip6_output.c: In function 'ip6_forward':
>> net/ipv6/ip6_output.c:536:13: warning: variable 'err' set but not used [-Wunused-but-set-variable]
     536 |         int err = -EINVAL;
         |             ^~~
   net/ipv6/ip6_output.c:535:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
     535 |         const char *dropreason;
         |                     ^~~~~~~~~~
   net/ipv6/ip6_output.c: In function '__ip6_append_data':
   net/ipv6/ip6_output.c:1547:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
    1547 |         const char *dropreason;
         |                     ^~~~~~~~~~
--
   net/ipv6/ip6_input.c: In function 'ip6_rcv_core':
>> net/ipv6/ip6_input.c:152:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
     152 |         const char *dropreason;
         |                     ^~~~~~~~~~
   net/ipv6/ip6_input.c: In function 'ip6_protocol_deliver_rcu':
   net/ipv6/ip6_input.c:389:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
     389 |         const char *dropreason;
         |                     ^~~~~~~~~~
   net/ipv6/ip6_input.c: In function 'ip6_input':
   net/ipv6/ip6_input.c:526:25: warning: unused variable 'hdr' [-Wunused-variable]
     526 |         struct ipv6hdr *hdr = ipv6_hdr(skb);
         |                         ^~~
--
   net/ipv6/raw.c: In function 'rawv6_send_hdrinc':
>> net/ipv6/raw.c:631:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
     631 |         const char *dropreason;
         |                     ^~~~~~~~~~
--
   net/ipv6/mcast.c: In function 'mld_sendpack':
>> net/ipv6/mcast.c:1796:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
    1796 |         const char *dropreason;
         |                     ^~~~~~~~~~
   net/ipv6/mcast.c: In function 'igmp6_send':
   net/ipv6/mcast.c:2167:21: warning: variable 'dropreason' set but not used [-Wunused-but-set-variable]
    2167 |         const char *dropreason;
         |                     ^~~~~~~~~~


vim +/dropreason +69 net/ipv6/ip6_output.c

    59	
    60	static int ip6_finish_output2(struct net *net, struct sock *sk, struct sk_buff *skb)
    61	{
    62		struct dst_entry *dst = skb_dst(skb);
    63		struct net_device *dev = dst->dev;
    64		struct inet6_dev *idev = ip6_dst_idev(dst);
    65		unsigned int hh_len = LL_RESERVED_SPACE(dev);
    66		const struct in6_addr *daddr, *nexthop;
    67		struct ipv6hdr *hdr;
    68		struct neighbour *neigh;
  > 69		const char *dropreason;
    70		int ret = 0;
    71	
    72		/* Be paranoid, rather than too clever. */
    73		if (unlikely(hh_len > skb_headroom(skb)) && dev->header_ops) {
    74			skb = skb_expand_head(skb, hh_len);
    75			if (!skb)
    76				goto oom;
    77		}
    78	
    79		hdr = ipv6_hdr(skb);
    80		daddr = &hdr->daddr;
    81		if (ipv6_addr_is_multicast(daddr)) {
    82			if (!(dev->flags & IFF_LOOPBACK) && sk_mc_loop(sk) &&
    83			    ((mroute6_is_socket(net, skb) &&
    84			     !(IP6CB(skb)->flags & IP6SKB_FORWARDED)) ||
    85			     ipv6_chk_mcast_addr(dev, daddr, &hdr->saddr))) {
    86				struct sk_buff *newskb = skb_clone(skb, GFP_ATOMIC);
    87	
    88				/* Do not check for IFF_ALLMULTI; multicast routing
    89				   is not supported in any case.
    90				 */
    91				if (newskb)
    92					NF_HOOK(NFPROTO_IPV6, NF_INET_POST_ROUTING,
    93						net, sk, newskb, NULL, newskb->dev,
    94						dev_loopback_xmit);
    95	
    96				if (hdr->hop_limit == 0) {
    97					dropreason = "hoplimit exceeded";
    98	
    99					IP6_INC_STATS(net, idev,
   100						      IPSTATS_MIB_OUTDISCARDS);
   101					goto drop;
   102				}
   103			}
   104	
   105			IP6_UPD_PO_STATS(net, idev, IPSTATS_MIB_OUTMCAST, skb->len);
   106			if (IPV6_ADDR_MC_SCOPE(daddr) <= IPV6_ADDR_SCOPE_NODELOCAL &&
   107			    !(dev->flags & IFF_LOOPBACK)) {
   108				dropreason = "invalid scope";
   109				goto drop;
   110			}
   111		}
   112	
   113		if (lwtunnel_xmit_redirect(dst->lwtstate)) {
   114			int res = lwtunnel_xmit(skb);
   115	
   116			if (res < 0 || res == LWTUNNEL_XMIT_DONE)
   117				return res;
   118		}
   119	
   120		rcu_read_lock_bh();
   121		nexthop = rt6_nexthop((struct rt6_info *)dst, daddr);
   122		neigh = __ipv6_neigh_lookup_noref(dev, nexthop);
   123		if (unlikely(!neigh))
   124			neigh = __neigh_create(&nd_tbl, nexthop, dev, false);
   125		if (!IS_ERR(neigh)) {
   126			sock_confirm_neigh(skb, neigh);
   127			ret = neigh_output(neigh, skb, false);
   128			rcu_read_unlock_bh();
   129			return ret;
   130		}
   131		rcu_read_unlock_bh();
   132	
   133		dropreason = "no route to host";
   134		IP6_INC_STATS(net, idev, IPSTATS_MIB_OUTNOROUTES);
   135		ret = -EINVAL;
   136	drop:
   137		DTRACE_IP(drop__out,
   138			  struct sk_buff * : pktinfo_t *, skb,
   139			  struct sock * : csinfo_t *, skb->sk,
   140			  void_ip_t * : ipinfo_t *, ipv6_hdr(skb),
   141			  struct net_device * : ifinfo_t *, skb->dev,
   142			  struct iphdr * : ipv4info_t *, NULL,
   143			  struct ipv6hdr * : ipv6info_t *, ipv6_hdr(skb),
   144			  const char * : string, dropreason);
   145		kfree_skb(skb);
   146		return ret;
   147	oom:
   148		DTRACE_IP(drop__out,
   149			  struct sk_buff * : pktinfo_t *, NULL,
   150			  struct sock * : csinfo_t *, NULL,
   151			  void_ip_t * : ipinfo_t *, NULL,
   152			  struct net_device * : ifinfo_t *, NULL,
   153			  struct iphdr * : ipv4info_t *, NULL,
   154			  struct ipv6hdr * : ipv6info_t *, NULL,
   155			  const char * : string, "out of memory");
   156		IP6_INC_STATS(net, idev, IPSTATS_MIB_OUTDISCARDS);
   157		return -ENOMEM;
   158	

---
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" (10477 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ