This is a note to let you know that I've just added the patch titled
net: fix a potential rcu_read_lock() imbalance in rt6_fill_node()
to the 3.0-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
net-fix-a-potential-rcu_read_lock-imbalance-in-rt6_fill_node.patch
and it can be found in the queue-3.0 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From 6c81e086f3da5ab72801dda2d7d8fc756219e7b9 Mon Sep 17 00:00:00 2001
From: Eric Dumazet <[email protected]>
Date: Tue, 27 Mar 2012 09:53:52 +0000
Subject: net: fix a potential rcu_read_lock() imbalance in rt6_fill_node()
From: Eric Dumazet <[email protected]>
[ Upstream commit 94f826b8076e2cb92242061e92f21b5baa3eccc2 ]
Commit f2c31e32b378 (net: fix NULL dereferences in check_peer_redir() )
added a regression in rt6_fill_node(), leading to rcu_read_lock()
imbalance.
Thats because NLA_PUT() can make a jump to nla_put_failure label.
Fix this by using nla_put()
Many thanks to Ben Greear for his help
Reported-by: Ben Greear <[email protected]>
Reported-by: Dave Jones <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Tested-by: Ben Greear <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/ipv6/route.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -2411,8 +2411,12 @@ static int rt6_fill_node(struct net *net
rcu_read_lock();
n = dst_get_neighbour(&rt->dst);
- if (n)
- NLA_PUT(skb, RTA_GATEWAY, 16, &n->primary_key);
+ if (n) {
+ if (nla_put(skb, RTA_GATEWAY, 16, &n->primary_key) < 0) {
+ rcu_read_unlock();
+ goto nla_put_failure;
+ }
+ }
rcu_read_unlock();
if (rt->dst.dev)
Patches currently in stable-queue which might be from [email protected] are
queue-3.0/net-bpf_jit-fix-bpf_s_ldx_b_msh-compilation.patch
queue-3.0/slub-do-not-hold-slub_lock-when-calling-sysfs_slab_add.patch
queue-3.0/net-fix-a-potential-rcu_read_lock-imbalance-in-rt6_fill_node.patch
queue-3.0/net-fix-napi_reuse_skb-skb-reserve.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html