All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Eric Dumazet <edumazet@google.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev, Simon Horman <horms@kernel.org>,
	Kuniyuki Iwashima <kuniyu@google.com>,
	David Ahern <dsahern@kernel.org>,
	netdev@vger.kernel.org, eric.dumazet@gmail.com,
	Eric Dumazet <edumazet@google.com>
Subject: Re: [PATCH net-next 09/10] ipv6: adopt skb_dst_dev() and skb_dst_dev_net[_rcu]() helpers
Date: Sat, 28 Jun 2025 10:15:42 +0800	[thread overview]
Message-ID: <202506281042.86fCDDNl-lkp@intel.com> (raw)
In-Reply-To: <20250627112526.3615031-10-edumazet@google.com>

Hi Eric,

kernel test robot noticed the following build errors:

[auto build test ERROR on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/net-dst-annotate-data-races-around-dst-obsolete/20250627-192850
base:   net-next/main
patch link:    https://lore.kernel.org/r/20250627112526.3615031-10-edumazet%40google.com
patch subject: [PATCH net-next 09/10] ipv6: adopt skb_dst_dev() and skb_dst_dev_net[_rcu]() helpers
config: x86_64-buildonly-randconfig-006-20250628 (https://download.01.org/0day-ci/archive/20250628/202506281042.86fCDDNl-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250628/202506281042.86fCDDNl-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506281042.86fCDDNl-lkp@intel.com/

All errors (new ones prefixed by >>):

   net/ipv6/exthdrs.c: In function 'ipv6_rthdr_rcv':
>> net/ipv6/exthdrs.c:786:41: error: too many arguments to function 'dev_net'
     786 |                 if (!ipv6_chk_home_addr(dev_net(skb_dst_dev(skb), addr)) {
         |                                         ^~~~~~~
   In file included from net/ipv6/exthdrs.c:25:
   include/linux/netdevice.h:2711:13: note: declared here
    2711 | struct net *dev_net(const struct net_device *dev)
         |             ^~~~~~~
>> net/ipv6/exthdrs.c:786:22: error: too few arguments to function 'ipv6_chk_home_addr'
     786 |                 if (!ipv6_chk_home_addr(dev_net(skb_dst_dev(skb), addr)) {
         |                      ^~~~~~~~~~~~~~~~~~
   In file included from include/net/ip6_route.h:5,
                    from net/ipv6/exthdrs.c:40:
   include/net/addrconf.h:122:5: note: declared here
     122 | int ipv6_chk_home_addr(struct net *net, const struct in6_addr *addr);
         |     ^~~~~~~~~~~~~~~~~~
>> net/ipv6/exthdrs.c:786:73: error: expected ')' before '{' token
     786 |                 if (!ipv6_chk_home_addr(dev_net(skb_dst_dev(skb), addr)) {
         |                    ~                                                    ^~
         |                                                                         )
>> net/ipv6/exthdrs.c:795:9: error: expected expression before '}' token
     795 |         }
         |         ^


vim +/dev_net +786 net/ipv6/exthdrs.c

   642	
   643	/********************************
   644	  Routing header.
   645	 ********************************/
   646	
   647	/* called with rcu_read_lock() */
   648	static int ipv6_rthdr_rcv(struct sk_buff *skb)
   649	{
   650		struct inet6_dev *idev = __in6_dev_get(skb->dev);
   651		struct inet6_skb_parm *opt = IP6CB(skb);
   652		struct in6_addr *addr = NULL;
   653		int n, i;
   654		struct ipv6_rt_hdr *hdr;
   655		struct rt0_hdr *rthdr;
   656		struct net *net = dev_net(skb->dev);
   657		int accept_source_route;
   658	
   659		accept_source_route = READ_ONCE(net->ipv6.devconf_all->accept_source_route);
   660	
   661		if (idev)
   662			accept_source_route = min(accept_source_route,
   663						  READ_ONCE(idev->cnf.accept_source_route));
   664	
   665		if (!pskb_may_pull(skb, skb_transport_offset(skb) + 8) ||
   666		    !pskb_may_pull(skb, (skb_transport_offset(skb) +
   667					 ((skb_transport_header(skb)[1] + 1) << 3)))) {
   668			__IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
   669			kfree_skb(skb);
   670			return -1;
   671		}
   672	
   673		hdr = (struct ipv6_rt_hdr *)skb_transport_header(skb);
   674	
   675		if (ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr) ||
   676		    skb->pkt_type != PACKET_HOST) {
   677			__IP6_INC_STATS(net, idev, IPSTATS_MIB_INADDRERRORS);
   678			kfree_skb(skb);
   679			return -1;
   680		}
   681	
   682		switch (hdr->type) {
   683		case IPV6_SRCRT_TYPE_4:
   684			/* segment routing */
   685			return ipv6_srh_rcv(skb);
   686		case IPV6_SRCRT_TYPE_3:
   687			/* rpl segment routing */
   688			return ipv6_rpl_srh_rcv(skb);
   689		default:
   690			break;
   691		}
   692	
   693	looped_back:
   694		if (hdr->segments_left == 0) {
   695			switch (hdr->type) {
   696	#if IS_ENABLED(CONFIG_IPV6_MIP6)
   697			case IPV6_SRCRT_TYPE_2:
   698				/* Silently discard type 2 header unless it was
   699				 * processed by own
   700				 */
   701				if (!addr) {
   702					__IP6_INC_STATS(net, idev,
   703							IPSTATS_MIB_INADDRERRORS);
   704					kfree_skb(skb);
   705					return -1;
   706				}
   707				break;
   708	#endif
   709			default:
   710				break;
   711			}
   712	
   713			opt->lastopt = opt->srcrt = skb_network_header_len(skb);
   714			skb->transport_header += (hdr->hdrlen + 1) << 3;
   715			opt->dst0 = opt->dst1;
   716			opt->dst1 = 0;
   717			opt->nhoff = (&hdr->nexthdr) - skb_network_header(skb);
   718			return 1;
   719		}
   720	
   721		switch (hdr->type) {
   722	#if IS_ENABLED(CONFIG_IPV6_MIP6)
   723		case IPV6_SRCRT_TYPE_2:
   724			if (accept_source_route < 0)
   725				goto unknown_rh;
   726			/* Silently discard invalid RTH type 2 */
   727			if (hdr->hdrlen != 2 || hdr->segments_left != 1) {
   728				__IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
   729				kfree_skb(skb);
   730				return -1;
   731			}
   732			break;
   733	#endif
   734		default:
   735			goto unknown_rh;
   736		}
   737	
   738		/*
   739		 *	This is the routing header forwarding algorithm from
   740		 *	RFC 2460, page 16.
   741		 */
   742	
   743		n = hdr->hdrlen >> 1;
   744	
   745		if (hdr->segments_left > n) {
   746			__IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
   747			icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
   748					  ((&hdr->segments_left) -
   749					   skb_network_header(skb)));
   750			return -1;
   751		}
   752	
   753		/* We are about to mangle packet header. Be careful!
   754		   Do not damage packets queued somewhere.
   755		 */
   756		if (skb_cloned(skb)) {
   757			/* the copy is a forwarded packet */
   758			if (pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) {
   759				__IP6_INC_STATS(net, ip6_dst_idev(skb_dst(skb)),
   760						IPSTATS_MIB_OUTDISCARDS);
   761				kfree_skb(skb);
   762				return -1;
   763			}
   764			hdr = (struct ipv6_rt_hdr *)skb_transport_header(skb);
   765		}
   766	
   767		if (skb->ip_summed == CHECKSUM_COMPLETE)
   768			skb->ip_summed = CHECKSUM_NONE;
   769	
   770		i = n - --hdr->segments_left;
   771	
   772		rthdr = (struct rt0_hdr *) hdr;
   773		addr = rthdr->addr;
   774		addr += i - 1;
   775	
   776		switch (hdr->type) {
   777	#if IS_ENABLED(CONFIG_IPV6_MIP6)
   778		case IPV6_SRCRT_TYPE_2:
   779			if (xfrm6_input_addr(skb, (xfrm_address_t *)addr,
   780					     (xfrm_address_t *)&ipv6_hdr(skb)->saddr,
   781					     IPPROTO_ROUTING) < 0) {
   782				__IP6_INC_STATS(net, idev, IPSTATS_MIB_INADDRERRORS);
   783				kfree_skb(skb);
   784				return -1;
   785			}
 > 786			if (!ipv6_chk_home_addr(dev_net(skb_dst_dev(skb), addr)) {
   787				__IP6_INC_STATS(net, idev, IPSTATS_MIB_INADDRERRORS);
   788				kfree_skb(skb);
   789				return -1;
   790			}
   791			break;
   792	#endif
   793		default:
   794			break;
 > 795		}
   796	
   797		if (ipv6_addr_is_multicast(addr)) {
   798			__IP6_INC_STATS(net, idev, IPSTATS_MIB_INADDRERRORS);
   799			kfree_skb(skb);
   800			return -1;
   801		}
   802	
   803		swap(*addr, ipv6_hdr(skb)->daddr);
   804	
   805		ip6_route_input(skb);
   806		if (skb_dst(skb)->error) {
   807			skb_push(skb, -skb_network_offset(skb));
   808			dst_input(skb);
   809			return -1;
   810		}
   811	
   812		if (skb_dst_dev(skb)->flags & IFF_LOOPBACK) {
   813			if (ipv6_hdr(skb)->hop_limit <= 1) {
   814				__IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
   815				icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
   816					    0);
   817				kfree_skb(skb);
   818				return -1;
   819			}
   820			ipv6_hdr(skb)->hop_limit--;
   821			goto looped_back;
   822		}
   823	
   824		skb_push(skb, -skb_network_offset(skb));
   825		dst_input(skb);
   826		return -1;
   827	
   828	unknown_rh:
   829		__IP6_INC_STATS(net, idev, IPSTATS_MIB_INHDRERRORS);
   830		icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
   831				  (&hdr->type) - skb_network_header(skb));
   832		return -1;
   833	}
   834	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

  parent reply	other threads:[~2025-06-28  2:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-27 11:25 [PATCH net-next 00/10] net: add data-race annotations around dst fields Eric Dumazet
2025-06-27 11:25 ` [PATCH net-next 01/10] net: dst: annotate data-races around dst->obsolete Eric Dumazet
2025-06-27 17:36   ` Kuniyuki Iwashima
2025-06-27 11:25 ` [PATCH net-next 02/10] net: dst: annotate data-races around dst->expires Eric Dumazet
2025-06-27 17:41   ` Kuniyuki Iwashima
2025-06-27 11:25 ` [PATCH net-next 03/10] net: dst: annotate data-races around dst->lastuse Eric Dumazet
2025-06-27 17:44   ` Kuniyuki Iwashima
2025-06-27 11:25 ` [PATCH net-next 04/10] net: dst: annotate data-races around dst->input Eric Dumazet
2025-06-27 17:51   ` Kuniyuki Iwashima
2025-06-27 11:25 ` [PATCH net-next 05/10] net: dst: annotate data-races around dst->output Eric Dumazet
2025-06-27 17:54   ` Kuniyuki Iwashima
2025-06-27 11:25 ` [PATCH net-next 06/10] net: dst: add four helpers to annotate data-races around dst->dev Eric Dumazet
2025-06-27 17:57   ` Kuniyuki Iwashima
2025-06-27 11:25 ` [PATCH net-next 07/10] ipv4: adopt dst_dev, skb_dst_dev and skb_dst_dev_net[_rcu] Eric Dumazet
2025-06-27 21:01   ` Kuniyuki Iwashima
2025-06-27 11:25 ` [PATCH net-next 08/10] ipv6: adopt dst_dev() helper Eric Dumazet
2025-06-27 21:04   ` Kuniyuki Iwashima
2025-06-27 11:25 ` [PATCH net-next 09/10] ipv6: adopt skb_dst_dev() and skb_dst_dev_net[_rcu]() helpers Eric Dumazet
2025-06-27 21:07   ` Kuniyuki Iwashima
2025-06-28  2:15   ` kernel test robot [this message]
2025-06-27 11:25 ` [PATCH net-next 10/10] ipv6: ip6_mc_input() and ip6_mr_input() cleanups Eric Dumazet
2025-06-27 21:09   ` Kuniyuki Iwashima

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202506281042.86fCDDNl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.