From: Hans Schillstrom <hans.schillstrom@ericsson.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "netfilter-devel@vger.kernel.org" <netfilter-devel@vger.kernel.org>
Subject: Re: conntrack, suspicious RCU usage
Date: Wed, 11 Jan 2012 14:44:31 +0100 [thread overview]
Message-ID: <201201111444.31605.hans.schillstrom@ericsson.com> (raw)
In-Reply-To: <1326288835.2767.26.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>
On Wednesday 11 January 2012 14:33:55 Eric Dumazet wrote:
> Le mercredi 11 janvier 2012 à 14:24 +0100, Hans Schillstrom a écrit :
> > On Wednesday 11 January 2012 11:01:51 Eric Dumazet wrote:
>
> > > Hmm, we either need to take rcu_read_lock() while calling
> > > __nf_ct_l3proto_find(), or define a variant using
> > > rcu_dereference_protected() in places we hold nf_conntrack_lock
> > >
> > I made a qick test with locks /unlocks in
> > __nf_ct_l3proto_find() and __nf_ct_l4proto_find()
> >
> > rcu_read_lock();
> > ...
> > rcu_read_unlock();
> > return retp;
> >
> > It seems to help, I cant see the dump anymore and everything else that I run works ...
> >
> >
>
> You cant do that, its just a brown paper bag :)
>
OK it didn't feel right ...
> If "retp" is returned, then the caller must handle the rcu_read_unlock()
> itself, after all possible "retp" dereferences.
>
> But really adding rcu_read_lock() should not be necessary on paths we
> own the conntrack lock. We should use rcu_dereference_protected()
> instead.
>
> I'll send a patch.
Thanks
Hans
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2012-01-11 13:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-11 9:25 conntrack, suspicious RCU usage Hans Schillstrom
2012-01-11 10:01 ` Eric Dumazet
2012-01-11 13:24 ` Hans Schillstrom
2012-01-11 13:33 ` Eric Dumazet
2012-01-11 13:44 ` Hans Schillstrom [this message]
2012-01-11 14:56 ` Eric Dumazet
2012-01-12 2:35 ` Pablo Neira Ayuso
2012-01-12 8:15 ` Hans Schillstrom
2012-01-12 2:30 ` 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=201201111444.31605.hans.schillstrom@ericsson.com \
--to=hans.schillstrom@ericsson.com \
--cc=eric.dumazet@gmail.com \
--cc=netfilter-devel@vger.kernel.org \
/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).