]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
rtnetlink: switch rtnl_link_get_slave_info_data_size to rcu
authorFlorian Westphal <fw@strlen.de>
Thu, 10 Aug 2017 14:52:59 +0000 (16:52 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Aug 2017 16:50:22 +0000 (09:50 -0700)
commit8515ae38435895ba2862840d3e82140fc0a77554
treeb7b2cd7e34d56bceb4c53d8058f81d6a3bf1748d
parent5c2bb9b6e27d9207c2e12b9cdb6bfc171afa663e
rtnetlink: switch rtnl_link_get_slave_info_data_size to rcu

David Ahern reports following splat:
 RTNL: assertion failed at net/core/dev.c (5717)
 netdev_master_upper_dev_get+0x5f/0x70
 if_nlmsg_size+0x158/0x240
 rtnl_calcit.isra.26+0xa3/0xf0

rtnl_link_get_slave_info_data_size currently assumes RTNL protection, but
there appears to be no hard requirement for this, so use rcu instead.

At the time of this writing, there are three 'get_slave_size' callbacks
(now invoked under rcu): bond_get_slave_size, vrf_get_slave_size and
br_port_get_slave_size, all return constant only (i.e. they don't sleep).

Fixes: 6853dd488119 ("rtnetlink: protect handler table with rcu")
Reported-by: David Ahern <dsahern@gmail.com>
Signed-off-by: Florian Westphal <fw@strlen.de>
Acked-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/rtnetlink.c