From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: netdev@vger.kernel.org, fan.du@windriver.com,
fengguang.wu@intel.com, Priyanka.Jain@freescale.com
Subject: Re: [PATCH net-next] xfrm: fix RCU bugs
Date: Wed, 22 Aug 2012 22:40:17 -0700 (PDT) [thread overview]
Message-ID: <20120822.224017.847590732390009999.davem@davemloft.net> (raw)
In-Reply-To: <1345372308.5158.54.camel@edumazet-glaptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 19 Aug 2012 12:31:48 +0200
> From: Eric Dumazet <edumazet@google.com>
>
> This patch reverts commit 56892261ed1a (xfrm: Use rcu_dereference_bh to
> deference pointer protected by rcu_read_lock_bh), and fixes bugs
> introduced in commit 418a99ac6ad ( Replace rwlock on xfrm_policy_afinfo
> with rcu )
>
> 1) We properly use RCU variant in this file, not a mix of RCU/RCU_BH
>
> 2) We must defer some writes after the synchronize_rcu() call or a reader
> can crash dereferencing NULL pointer.
>
> 3) Now we use the xfrm_policy_afinfo_lock spinlock only from process
> context, we no longer need to block BH in xfrm_policy_register_afinfo()
> and xfrm_policy_unregister_afinfo()
>
> 4) Can use RCU_INIT_POINTER() instead of rcu_assign_pointer() in
> xfrm_policy_unregister_afinfo()
>
> 5) Remove a forward inline declaration (xfrm_policy_put_afinfo()),
> and also move xfrm_policy_get_afinfo() declaration.
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
Applied, thanks Eric.
prev parent reply other threads:[~2012-08-23 5:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-19 10:31 [PATCH net-next] xfrm: fix RCU bugs Eric Dumazet
2012-08-20 4:40 ` Fan Du
2012-08-20 5:33 ` Eric Dumazet
2012-08-20 6:33 ` Fan Du
2012-08-20 7:14 ` Eric Dumazet
2012-08-23 5:40 ` David Miller [this message]
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=20120822.224017.847590732390009999.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=Priyanka.Jain@freescale.com \
--cc=eric.dumazet@gmail.com \
--cc=fan.du@windriver.com \
--cc=fengguang.wu@intel.com \
--cc=netdev@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).