diff mbox

[3.8.y.z,extended,stable] Patch "skbuff: skb_segment: orphan frags before copying" has been added to staging queue

Message ID 1402962238-30779-1-git-send-email-kamal@canonical.com
State New
Headers show

Commit Message

Kamal Mostafa June 16, 2014, 11:43 p.m. UTC
This is a note to let you know that I have just added a patch titled

    skbuff: skb_segment: orphan frags before copying

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.24.

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 dba8b7ab6af6bfa2dc11833327b4227426403d4b Mon Sep 17 00:00:00 2001
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Fri, 13 Jun 2014 12:12:28 +0100
Subject: skbuff: skb_segment: orphan frags before copying

commit 1fd819ecb90cc9b822cd84d3056ddba315d3340f upstream.

skb_segment copies frags around, so we need
to copy them carefully to avoid accessing
user memory after reporting completion to userspace
through a callback.

skb_segment doesn't normally happen on datapath:
TSO needs to be disabled - so disabling zero copy
in this case does not look like a big deal.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
(back ported from commit 1fd819ecb90cc9b822cd84d3056ddba315d3340f)
CVE-2014-0131
BugLink: http://bugs.launchpad.net/bugs/1298119
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
---
 net/core/skbuff.c | 3 +++
 1 file changed, 3 insertions(+)

--
1.9.1
diff mbox

Patch

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index f97fe58..1cee7e3 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2826,6 +2826,9 @@  struct sk_buff *skb_segment(struct sk_buff *skb, netdev_features_t features)
 						 skb_put(nskb, hsize), hsize);

 		while (pos < offset + len && i < nfrags) {
+			if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC)))
+				goto err;
+
 			*frag = skb_shinfo(skb)->frags[i];
 			__skb_frag_ref(frag);
 			size = skb_frag_size(frag);