]> git.baikalelectronics.ru Git - kernel.git/commit
net: change addr_list_lock back to static key
authorCong Wang <xiyou.wangcong@gmail.com>
Mon, 8 Jun 2020 21:53:01 +0000 (14:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Tue, 9 Jun 2020 19:59:45 +0000 (12:59 -0700)
commitf31ab2b7ac1af912468eb57790d374e80f045fd4
tree053282d21248269b50668f920d39ba07b7a0277d
parent072745434210424f8cb39bdcdbdfe4d3fb882c82
net: change addr_list_lock back to static key

The dynamic key update for addr_list_lock still causes troubles,
for example the following race condition still exists:

CPU 0: CPU 1:
(RCU read lock) (RTNL lock)
dev_mc_seq_show() netdev_update_lockdep_key()
  -> lockdep_unregister_key()
 -> netif_addr_lock_bh()

because lockdep doesn't provide an API to update it atomically.
Therefore, we have to move it back to static keys and use subclass
for nest locking like before.

In commit 92cfcc5c5313 ("net: partially revert dynamic lockdep key
changes"), I already reverted most parts of commit dba6ed4c4b1e
("net: core: add generic lockdep keys").

This patch reverts the rest and also part of commit e4eef209012a
("net: remove unnecessary variables and callback"). After this
patch, addr_list_lock changes back to using static keys and
subclasses to satisfy lockdep. Thanks to dev->lower_level, we do
not have to change back to ->ndo_get_lock_subclass().

And hopefully this reduces some syzbot lockdep noises too.

Reported-by: syzbot+f3a0e80c34b3fc28ac5e@syzkaller.appspotmail.com
Cc: Taehee Yoo <ap420073@gmail.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
17 files changed:
drivers/net/bonding/bond_main.c
drivers/net/bonding/bond_options.c
drivers/net/hamradio/bpqether.c
drivers/net/macsec.c
drivers/net/macvlan.c
drivers/net/vxlan.c
drivers/net/wireless/intersil/hostap/hostap_hw.c
include/linux/netdevice.h
net/8021q/vlan_dev.c
net/batman-adv/soft-interface.c
net/bridge/br_device.c
net/core/dev.c
net/core/dev_addr_lists.c
net/core/rtnetlink.c
net/dsa/master.c
net/netrom/af_netrom.c
net/rose/af_rose.c