[3.8.y.z extended stable] Patch "bridge: use br_port_get_rtnl within rtnl lock" has been added to staging queue
Kamal Mostafa
kamal at canonical.com
Mon Oct 28 21:59:29 UTC 2013
This is a note to let you know that I have just added a patch titled
bridge: use br_port_get_rtnl within rtnl lock
to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue
This patch is scheduled to be released in version 3.8.13.12.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
------
>From b98fdf5ca289109a0c7eb5d699aaf271a7a86e71 Mon Sep 17 00:00:00 2001
From: Hong Zhiguo <zhiguohong at tencent.com>
Date: Sat, 14 Sep 2013 22:42:27 +0800
Subject: bridge: use br_port_get_rtnl within rtnl lock
[ Upstream commit 1fb1754a8c70d69ab480763c423e0a74369c4a67 ]
current br_port_get_rcu is problematic in bridging path
(NULL deref). Change these calls in netlink path first.
Signed-off-by: Hong Zhiguo <zhiguohong at tencent.com>
Acked-by: Eric Dumazet <edumazet at google.com>
Signed-off-by: David S. Miller <davem at davemloft.net>
[ kamal: backport to 3.8 (context) ]
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
net/bridge/br_netlink.c | 2 +-
net/bridge/br_private.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c
index 580e176..cd7b013 100644
--- a/net/bridge/br_netlink.c
+++ b/net/bridge/br_netlink.c
@@ -152,7 +152,7 @@ int br_getlink(struct sk_buff *skb, u32 pid, u32 seq,
struct net_device *dev)
{
int err = 0;
- struct net_bridge_port *port = br_port_get_rcu(dev);
+ struct net_bridge_port *port = br_port_get_rtnl(dev);
/* not a bridge port */
if (!port)
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index e943215..688fc44 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -168,7 +168,7 @@ static inline struct net_bridge_port *br_port_get_rcu(const struct net_device *d
return br_port_exists(dev) ? port : NULL;
}
-static inline struct net_bridge_port *br_port_get_rtnl(struct net_device *dev)
+static inline struct net_bridge_port *br_port_get_rtnl(const struct net_device *dev)
{
return br_port_exists(dev) ?
rtnl_dereference(dev->rx_handler_data) : NULL;
--
1.8.1.2
More information about the kernel-team
mailing list