[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM_iQpX9N5UswtQPAe__baUm4hU3vKZ5tQFyAE61qHAQSfcbWQ@mail.gmail.com>
Date: Thu, 6 May 2021 14:30:51 -0700
From: Cong Wang <xiyou.wangcong@...il.com>
To: Taehee Yoo <ap420073@...il.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Cong Wang <cong.wang@...edance.com>,
syzbot <syzbot+7d941e89dd48bcf42573@...kaller.appspotmail.com>
Subject: Re: [Patch net] rtnetlink: use rwsem to protect rtnl_af_ops list
On Thu, May 6, 2021 at 5:26 AM Taehee Yoo <ap420073@...il.com> wrote:
>
> On 5/6/21 8:36 AM, Cong Wang wrote:
> > From: Cong Wang <cong.wang@...edance.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@...kaller.appspotmail.com
> > Fixes: 63ed8de4be81 ("mld: add mc_lock for protecting per-interface
> mld data")
> > Cc: Taehee Yoo <ap420073@...il.com>
> > Signed-off-by: Cong Wang <cong.wang@...edance.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.
Thanks.
View attachment "rtnetlink.diff" of type "text/x-patch" (2630 bytes)
Powered by blists - more mailing lists