netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Li RongQing <lirongqing@baidu.com>
Cc: kbuild-all@01.org, netdev@vger.kernel.org
Subject: Re: [PATCH][net-next] ipv6: sanitize RCU usage on fib6_next
Date: Sun, 24 Feb 2019 11:19:09 +0800	[thread overview]
Message-ID: <201902241121.AwkaErQt%fengguang.wu@intel.com> (raw)
In-Reply-To: <1550828682-10608-1-git-send-email-lirongqing@baidu.com>

[-- Attachment #1: Type: text/plain, Size: 3840 bytes --]

Hi Li,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on net/master]
[also build test WARNING on v5.0-rc4 next-20190222]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Li-RongQing/ipv6-sanitize-RCU-usage-on-fib6_next/20190224-083824
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'

All warnings (new ones prefixed by >>):

>> net/ipv6/ip6_fib.c:1764:14: sparse: warning: incorrect type in assignment (different address spaces)
   net/ipv6/ip6_fib.c:1764:14: sparse:    expected struct fib6_info [noderef] <asn:4> *
   net/ipv6/ip6_fib.c:1764:14: sparse:    got struct fib6_info *

sparse warnings: (new ones prefixed by >>)

   net/ipv6/ip6_fib.c:1764:14: sparse: warning: incorrect type in assignment (different address spaces)
>> net/ipv6/ip6_fib.c:1764:14: sparse:    expected struct fib6_info [noderef] <asn:4> *
>> net/ipv6/ip6_fib.c:1764:14: sparse:    got struct fib6_info *

vim +1764 net/ipv6/ip6_fib.c

  1752	
  1753	static void fib6_del_route(struct fib6_table *table, struct fib6_node *fn,
  1754				   struct fib6_info __rcu **rtp, struct nl_info *info)
  1755	{
  1756		struct fib6_walker *w;
  1757		struct fib6_info *rt = rcu_dereference_protected(*rtp,
  1758					    lockdep_is_held(&table->tb6_lock));
  1759		struct net *net = info->nl_net;
  1760	
  1761		RT6_TRACE("fib6_del_route\n");
  1762	
  1763		/* Unlink it */
> 1764		*rtp = rcu_dereference_protected(rt->fib6_next,
  1765					    lockdep_is_held(&rt->fib6_table->tb6_lock));
  1766	
  1767		rt->fib6_node = NULL;
  1768		net->ipv6.rt6_stats->fib_rt_entries--;
  1769		net->ipv6.rt6_stats->fib_discarded_routes++;
  1770	
  1771		/* Flush all cached dst in exception table */
  1772		rt6_flush_exceptions(rt);
  1773	
  1774		/* Reset round-robin state, if necessary */
  1775		if (rcu_access_pointer(fn->rr_ptr) == rt)
  1776			fn->rr_ptr = NULL;
  1777	
  1778		/* Remove this entry from other siblings */
  1779		if (rt->fib6_nsiblings) {
  1780			struct fib6_info *sibling, *next_sibling;
  1781	
  1782			list_for_each_entry_safe(sibling, next_sibling,
  1783						 &rt->fib6_siblings, fib6_siblings)
  1784				sibling->fib6_nsiblings--;
  1785			rt->fib6_nsiblings = 0;
  1786			list_del_init(&rt->fib6_siblings);
  1787			rt6_multipath_rebalance(next_sibling);
  1788		}
  1789	
  1790		/* Adjust walkers */
  1791		read_lock(&net->ipv6.fib6_walker_lock);
  1792		FOR_WALKERS(net, w) {
  1793			if (w->state == FWS_C && w->leaf == rt) {
  1794				RT6_TRACE("walker %p adjusted by delroute\n", w);
  1795				w->leaf = rcu_dereference_protected(rt->fib6_next,
  1796						    lockdep_is_held(&table->tb6_lock));
  1797				if (!w->leaf)
  1798					w->state = FWS_U;
  1799			}
  1800		}
  1801		read_unlock(&net->ipv6.fib6_walker_lock);
  1802	
  1803		/* If it was last route, call fib6_repair_tree() to:
  1804		 * 1. For root node, put back null_entry as how the table was created.
  1805		 * 2. For other nodes, expunge its radix tree node.
  1806		 */
  1807		if (!rcu_access_pointer(fn->leaf)) {
  1808			if (!(fn->fn_flags & RTN_TL_ROOT)) {
  1809				fn->fn_flags &= ~RTN_RTINFO;
  1810				net->ipv6.rt6_stats->fib_route_nodes--;
  1811			}
  1812			fn = fib6_repair_tree(net, table, fn);
  1813		}
  1814	
  1815		fib6_purge_rt(rt, fn, net);
  1816	
  1817		call_fib6_entry_notifiers(net, FIB_EVENT_ENTRY_DEL, rt, NULL);
  1818		if (!info->skip_notify)
  1819			inet6_rt_notify(RTM_DELROUTE, rt, info, 0);
  1820		fib6_info_release(rt);
  1821	}
  1822	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 67242 bytes --]

      parent reply	other threads:[~2019-02-24  3:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-22  9:44 [PATCH][net-next] ipv6: sanitize RCU usage on fib6_next Li RongQing
2019-02-22 22:35 ` David Ahern
2019-02-22 23:08 ` Eric Dumazet
2019-02-24  3:19 ` kbuild test robot [this message]

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=201902241121.AwkaErQt%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@01.org \
    --cc=lirongqing@baidu.com \
    --cc=netdev@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).