diff options
author | Cong Wang <cong.wang@bytedance.com> | 2021-05-08 11:00:33 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-05-10 14:33:10 -0700 |
commit | a100243d95a60d74ae9bb9df1f5f2192e9aed6a7 (patch) | |
tree | 5c614edec5ccc729eae58fb83e8ef43026f9e9ad /mm | |
parent | 3f8fca5d43357ab3ae678d908ac3c74e07503f0d (diff) | |
download | linux-a100243d95a60d74ae9bb9df1f5f2192e9aed6a7.tar.bz2 |
rtnetlink: avoid RCU read lock when holding RTNL
When we call af_ops->set_link_af() we hold a RCU read lock
as we retrieve af_ops from the RCU protected list, but this
is unnecessary because we already hold RTNL lock, which is
the writer lock for protecting rtnl_af_ops, so it is safer
than RCU read lock. Similar for af_ops->validate_link_af().
This was not a problem until we begin to take mutex lock
down the path of ->set_link_af() in __ipv6_dev_mc_dec()
recently. We can just drop the RCU read lock there and
assert RTNL lock.
Reported-and-tested-by: syzbot+7d941e89dd48bcf42573@syzkaller.appspotmail.com
Fixes: 63ed8de4be81 ("mld: add mc_lock for protecting per-interface mld data")
Tested-by: Taehee Yoo <ap420073@gmail.com>
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions