From: Nicholas Krause <xerofoify@gmail.com>
To: pablo@netfilter.org
Cc: netdev@vger.kernel.org, bridge@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, kaber@trash.net,
coreteam@netfilter.org, netfilter-devel@vger.kernel.org,
kadlec@blackhole.kfki.hu, davem@davemloft.net
Subject: [PATCH RESEND] bridge:Fix concurrent access issue in the function brnf_get_logical_dev
Date: Mon, 1 Feb 2016 22:19:33 -0500 [thread overview]
Message-ID: <1454383173-9560-1-git-send-email-xerofoify@gmail.com> (raw)
This fixes a concurrent access issue in the function brnf_get_logical_dev
by properly locking with the function rcu_read_lock before calling the
function vlan_find_dev_deep_rcu and unlocking after this function call
as all callers of this function are required to do this in order to
improve issues with concurrent access by other threads executing
on this data structures simultaneously.
Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
net/bridge/br_netfilter_hooks.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c
index c8b9bcf..73c84a8 100644
--- a/net/bridge/br_netfilter_hooks.c
+++ b/net/bridge/br_netfilter_hooks.c
@@ -428,9 +428,10 @@ static struct net_device *brnf_get_logical_dev(struct sk_buff *skb, const struct
if (brnf_pass_vlan_indev == 0 || !skb_vlan_tag_present(skb))
return br;
+ rcu_read_lock();
vlan = __vlan_find_dev_deep_rcu(br, skb->vlan_proto,
skb_vlan_tag_get(skb) & VLAN_VID_MASK);
-
+ rcu_read_unlock();
return vlan ? vlan : br;
}
--
2.1.4
next reply other threads:[~2016-02-02 3:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-02 3:19 Nicholas Krause [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-01-01 6:17 [PATCH RESEND] bridge:Fix concurrent access issue in the function brnf_get_logical_dev Nicholas Krause
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=1454383173-9560-1-git-send-email-xerofoify@gmail.com \
--to=xerofoify@gmail.com \
--cc=bridge@lists.linux-foundation.org \
--cc=coreteam@netfilter.org \
--cc=davem@davemloft.net \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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).