Patch "virtio_net: don't leak memory or block when too many frags" has been added to the 3.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    virtio_net: don't leak memory or block when too many frags

to the 3.10-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:
     virtio_net-don-t-leak-memory-or-block-when-too-many-frags.patch
and it can be found in the queue-3.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From foo@baz Mon Jan 13 09:39:01 PST 2014
From: "Michael S. Tsirkin" <mst@xxxxxxxxxx>
Date: Thu, 26 Dec 2013 15:32:55 +0200
Subject: virtio_net: don't leak memory or block when too many frags

From: "Michael S. Tsirkin" <mst@xxxxxxxxxx>

We leak an skb when there are too many frags,
we also stop processing the packet in the middle,
the result is almost sure to be loss of networking.

Reported-by: Michael Dalton <mwdalton@xxxxxxxxxx>
Acked-by: Michael Dalton <mwdalton@xxxxxxxxxx>
Signed-off-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/net/virtio_net.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -341,7 +341,7 @@ static struct sk_buff *receive_mergeable
 		if (i >= MAX_SKB_FRAGS) {
 			pr_debug("%s: packet too long\n", skb->dev->name);
 			skb->dev->stats.rx_length_errors++;
-			return NULL;
+			goto err_frags;
 		}
 		page = virtqueue_get_buf(rq->vq, &len);
 		if (!page) {
@@ -362,6 +362,7 @@ static struct sk_buff *receive_mergeable
 err_skb:
 	give_pages(rq, page);
 	while (--num_buf) {
+err_frags:
 		buf = virtqueue_get_buf(rq->vq, &len);
 		if (unlikely(!buf)) {
 			pr_debug("%s: rx error: %d buffers missing\n",


Patches currently in stable-queue which might be from mst@xxxxxxxxxx are

queue-3.10/macvtap-signal-truncated-packets.patch
queue-3.10/virtio-net-make-all-rx-paths-handle-errors-consistently.patch
queue-3.10/virtio_net-fix-error-handling-for-mergeable-buffers.patch
queue-3.10/macvtap-do-not-double-count-received-packets.patch
queue-3.10/virtio-net-fix-refill-races-during-restore.patch
queue-3.10/virtio_net-don-t-leak-memory-or-block-when-too-many-frags.patch
queue-3.10/virtio-delete-napi-structures-from-netdev-before-releasing-memory.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]