public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Taehee Yoo <ap420073@gmail.com>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>,
	Cong Wang <cong.wang@bytedance.com>,
	syzbot <syzbot+7d941e89dd48bcf42573@syzkaller.appspotmail.com>
Subject: Re: [Patch net] rtnetlink: use rwsem to protect rtnl_af_ops list
Date: Sat, 8 May 2021 17:22:21 +0900	[thread overview]
Message-ID: <68687fbb-d433-0f7a-9a3b-59f497ce6563@gmail.com> (raw)
In-Reply-To: <CAM_iQpX9N5UswtQPAe__baUm4hU3vKZ5tQFyAE61qHAQSfcbWQ@mail.gmail.com>

On 5/7/21 6:30 AM, Cong Wang wrote:
 > On Thu, May 6, 2021 at 5:26 AM Taehee Yoo <ap420073@gmail.com> wrote:
 >>
 >> On 5/6/21 8:36 AM, Cong Wang wrote:
 >>   > From: Cong Wang <cong.wang@bytedance.com>
 >>   >
 >>
 >> Hi Cong,
 >> Thank you so much for fixing it!
 >>
 >>   > We use RTNL lock and RCU read lock to protect the global
 >>   > list rtnl_af_ops, however, this forces the af_ops readers
 >>   > being in atomic context while iterating this list,
 >>   > particularly af_ops->set_link_af(). This was not a problem
 >>   > until we begin to take mutex lock down the path in
 >>   > __ipv6_dev_mc_dec().
 >>   >
 >>   > Convert RTNL+RCU to rwsemaphore, so that we can block on
 >>   > the reader side while still allowing parallel readers.
 >>   >
 >>   > Reported-and-tested-by:
 >> syzbot+7d941e89dd48bcf42573@syzkaller.appspotmail.com
 >>   > Fixes: 63ed8de4be81 ("mld: add mc_lock for protecting per-interface
 >> mld data")
 >>   > Cc: Taehee Yoo <ap420073@gmail.com>
 >>   > Signed-off-by: Cong Wang <cong.wang@bytedance.com>
 >>
 >> I have been testing this patch and I found a warning
 >
 > Ah, good catch! I clearly missed that code path.
 >
 > Can you help test the attached patch? syzbot is happy with it at least,
 > my CI bot is down so I can't run selftests for now.
 >

Hi Cong,
I have tested the attached patch with the syzbot reproducer and my own 
reproducer.
I couldn't find any problems such as warnings and other splats.
Thanks a lot!
Taehee

  parent reply	other threads:[~2021-05-08  8:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-05 23:36 [Patch net] rtnetlink: use rwsem to protect rtnl_af_ops list Cong Wang
2021-05-06 12:26 ` Taehee Yoo
2021-05-06 21:30   ` Cong Wang
2021-05-07  2:25     ` Taehee Yoo
2021-05-08  8:22     ` Taehee Yoo [this message]
2021-05-09 13:14 ` [rtnetlink] aced02f261: BUG:sleeping_function_called_from_invalid_context_at_kernel/locking/rwsem.c kernel test robot

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=68687fbb-d433-0f7a-9a3b-59f497ce6563@gmail.com \
    --to=ap420073@gmail.com \
    --cc=cong.wang@bytedance.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+7d941e89dd48bcf42573@syzkaller.appspotmail.com \
    --cc=xiyou.wangcong@gmail.com \
    /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