netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hong Zhiguo <honkiko@gmail.com>
To: vyasevic@redhat.com
Cc: eric.dumazet@gmail.com, davem@davemloft.net,
	netdev@vger.kernel.org, Hong Zhiguo <zhiguohong@tencent.com>
Subject: [PATCH net-next] fix NULL pointer dereference in br_handle_frame
Date: Thu, 12 Sep 2013 23:57:08 +0800	[thread overview]
Message-ID: <1379001428-2727-1-git-send-email-zhiguohong@tencent.com> (raw)
In-Reply-To: <1378988195-2710-1-git-send-email-zhiguohong@tencent.com>

not check IFF_BRIDGE_PORT within br_handle_frame

Signed-off-by: Hong Zhiguo <zhiguohong@tencent.com>
---
 net/bridge/br_input.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/bridge/br_input.c b/net/bridge/br_input.c
index a2fd37e..da4714a 100644
--- a/net/bridge/br_input.c
+++ b/net/bridge/br_input.c
@@ -60,7 +60,7 @@ static int br_pass_frame_up(struct sk_buff *skb)
 int br_handle_frame_finish(struct sk_buff *skb)
 {
 	const unsigned char *dest = eth_hdr(skb)->h_dest;
-	struct net_bridge_port *p = br_port_get_rcu(skb->dev);
+	enet_bridge_port *p = rcu_dereference(skb->dev->rx_handler_data);
 	struct net_bridge *br;
 	struct net_bridge_fdb_entry *dst;
 	struct net_bridge_mdb_entry *mdst;
@@ -143,7 +143,7 @@ drop:
 /* note: already called with rcu_read_lock */
 static int br_handle_local_finish(struct sk_buff *skb)
 {
-	struct net_bridge_port *p = br_port_get_rcu(skb->dev);
+	struct net_bridge_port *p = rcu_dereference(skb->dev->rx_handler_data);
 	u16 vid = 0;
 
 	br_vlan_get_tag(skb, &vid);
@@ -173,7 +173,7 @@ rx_handler_result_t br_handle_frame(struct sk_buff **pskb)
 	if (!skb)
 		return RX_HANDLER_CONSUMED;
 
-	p = br_port_get_rcu(skb->dev);
+	p = rcu_dereference(skb->dev->rx_handler_data);
 
 	if (unlikely(is_link_local_ether_addr(dest))) {
 		/*
-- 
1.7.0.4

  parent reply	other threads:[~2013-09-12 15:57 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12 12:16 [PATCH net-next] fix NULL pointer dereference in br_handle_frame Hong Zhiguo
2013-09-12 14:11 ` Eric Dumazet
2013-09-12 14:24   ` Hong zhi guo
2013-09-12 14:33     ` Eric Dumazet
2013-09-12 14:42       ` Vlad Yasevich
2013-09-12 15:24         ` Eric Dumazet
2013-09-12 15:50           ` Vlad Yasevich
2013-09-12 16:08             ` Eric Dumazet
2013-09-12 15:57 ` Hong Zhiguo [this message]
2013-09-12 16:06   ` Hong zhi guo
2013-09-12 16:11     ` Eric Dumazet
2013-09-12 16:18       ` Hong zhi guo
2013-09-12 16:19         ` Eric Dumazet
2013-09-12 16:12   ` Eric Dumazet
2013-09-12 19:18   ` David Miller
2013-09-13  3:09 ` [PATCH net-next] bridge: fix NULL pointer deref " Hong Zhiguo
2013-09-13 16:21   ` Stephen Hemminger

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=1379001428-2727-1-git-send-email-zhiguohong@tencent.com \
    --to=honkiko@gmail.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vyasevic@redhat.com \
    --cc=zhiguohong@tencent.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).