This is a note to let you know that I've just added the patch titled
net: fix secpath kmemleak
to the 3.6-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-secpath-kmemleak.patch
and it can be found in the queue-3.6 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.
>From aa0dfee5c6f808526f4ca425343a4f95a7c5e6ad Mon Sep 17 00:00:00 2001
From: Eric Dumazet <[email protected]>
Date: Mon, 22 Oct 2012 09:03:40 +0000
Subject: net: fix secpath kmemleak
From: Eric Dumazet <[email protected]>
[ Upstream commit 3d861f661006606bf159fd6bd973e83dbf21d0f9 ]
Mike Kazantsev found 3.5 kernels and beyond were leaking memory,
and tracked the faulty commit to a1c7fff7e18f59e ("net:
netdev_alloc_skb() use build_skb()")
While this commit seems fine, it uncovered a bug introduced
in commit bad43ca8325 ("net: introduce skb_try_coalesce()), in function
kfree_skb_partial()"):
If head is stolen, we free the sk_buff,
without removing references on secpath (skb->sp).
So IPsec + IP defrag/reassembly (using skb coalescing), or
TCP coalescing could leak secpath objects.
Fix this bug by calling skb_release_head_state(skb) to properly
release all possible references to linked objects.
Reported-by: Mike Kazantsev <[email protected]>
Signed-off-by: Eric Dumazet <[email protected]>
Bisected-by: Mike Kazantsev <[email protected]>
Tested-by: Mike Kazantsev <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
net/core/skbuff.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3384,10 +3384,12 @@ EXPORT_SYMBOL(__skb_warn_lro_forwarding)
void kfree_skb_partial(struct sk_buff *skb, bool head_stolen)
{
- if (head_stolen)
+ if (head_stolen) {
+ skb_release_head_state(skb);
kmem_cache_free(skbuff_head_cache, skb);
- else
+ } else {
__kfree_skb(skb);
+ }
}
EXPORT_SYMBOL(kfree_skb_partial);
Patches currently in stable-queue which might be from [email protected] are
queue-3.6/net-fix-secpath-kmemleak.patch
queue-3.6/netlink-use-kfree_rcu-in-netlink_release.patch
queue-3.6/tcp-fix-fionread-siocinq.patch
queue-3.6/net-fix-divide-by-zero-in-tcp-algorithm-illinois.patch
queue-3.6/ipv4-fix-flushing-of-cached-routing-informations.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