https://github.com/torvalds/linux
Revision 419df12fb5fa558451319276838c1842f2b11f8f authored by WANG Cong on 31 March 2015, 18:01:46 UTC, committed by David S. Miller on 03 April 2015, 00:52:34 UTC
We have to hold rtnl lock for fib_rules_unregister()
otherwise the following race could happen:

fib_rules_unregister():	fib_nl_delrule():
...				...
...				ops = lookup_rules_ops();
list_del_rcu(&ops->list);
				list_for_each_entry(ops->rules) {
fib_rules_cleanup_ops(ops);	  ...
  list_del_rcu();		  list_del_rcu();
				}

Note, net->rules_mod_lock is actually not needed at all,
either upper layer netns code or rtnl lock guarantees
we are safe.

Cc: Alexander Duyck <alexander.h.duyck@redhat.com>
Cc: Thomas Graf <tgraf@suug.ch>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ed78530
Raw File
Tip revision: 419df12fb5fa558451319276838c1842f2b11f8f authored by WANG Cong on 31 March 2015, 18:01:46 UTC
net: move fib_rules_unregister() under rtnl lock
Tip revision: 419df12
.gitignore
#
# Generated files
#
conmakehash
kallsyms
pnmtologo
unifdef
ihex2fw
recordmcount
docproc
sortextable
asn1_compiler
back to top