From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Ulrich Weber <ulrich.weber@sophos.com>,
netfilter-devel@vger.kernel.org
Subject: Re: [PATCH net-next] nat: remove obsolete rcu_read_unlock call
Date: Fri, 21 Sep 2012 21:47:07 +0200 [thread overview]
Message-ID: <20120921194707.GA32377@1984> (raw)
In-Reply-To: <20120921100842.1608006f@nehalam.linuxnetplumber.net>
On Fri, Sep 21, 2012 at 10:08:42AM -0700, Stephen Hemminger wrote:
> On Thu, 20 Sep 2012 16:14:45 +0200
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> > On Thu, 2012-09-20 at 15:52 +0200, Ulrich Weber wrote:
> > > hlist walk in find_appropriate_src() is not protected anymore by rcu_read_lock(),
> > > so rcu_read_unlock() is unnecessary if in_range() matches.
> > >
> > > Signed-off-by: Ulrich Weber <ulrich.weber@sophos.com>
> > > ---
> > > net/netfilter/nf_nat_core.c | 4 +---
> > > 1 file changed, 1 insertion(+), 3 deletions(-)
> > >
> > > diff --git a/net/netfilter/nf_nat_core.c b/net/netfilter/nf_nat_core.c
> > > index 1816ad3..125d832 100644
> > > --- a/net/netfilter/nf_nat_core.c
> > > +++ b/net/netfilter/nf_nat_core.c
> > > @@ -201,10 +201,8 @@ find_appropriate_src(struct net *net, u16 zone,
> > > &ct->tuplehash[IP_CT_DIR_REPLY].tuple);
> > > result->dst = tuple->dst;
> > >
> > > - if (in_range(l3proto, l4proto, result, range)) {
> > > - rcu_read_unlock();
> > > + if (in_range(l3proto, l4proto, result, range))
> > > return 1;
> > > - }
> > > }
> > > }
> > > return 0;
> >
> >
> > This could explain the rcu_read_unlock() imbalance Stephen had (lockdep
> > splat with net-next)
> >
> >
> > How old is this bug ?
> >
> >
> >
>
> This fixes the lockdep splat I saw when staring KVM vm's with net-next and lockdep enabled
It's in my tree already.
I'll pass it to David asap. Thanks for the report.
next prev parent reply other threads:[~2012-09-21 19:47 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 13:52 [PATCH net-next] nat: remove obsolete rcu_read_unlock call Ulrich Weber
2012-09-20 14:14 ` Eric Dumazet
2012-09-20 14:17 ` Ulrich Weber
2012-09-21 10:14 ` Pablo Neira Ayuso
2012-09-20 16:27 ` Stephen Hemminger
2012-09-21 17:08 ` Stephen Hemminger
2012-09-21 19:47 ` Pablo Neira Ayuso [this message]
2012-09-21 10:14 ` Pablo Neira Ayuso
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=20120921194707.GA32377@1984 \
--to=pablo@netfilter.org \
--cc=eric.dumazet@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
--cc=shemminger@vyatta.com \
--cc=ulrich.weber@sophos.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;
as well as URLs for NNTP newsgroup(s).