Patch "virtio_net: check return value of skb_to_sgvec in one more location" has been added to the 4.9-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: check return value of skb_to_sgvec in one more location

to the 4.9-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-check-return-value-of-skb_to_sgvec-in-one-more-location.patch
and it can be found in the queue-4.9 subdirectory.

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


>From natechancellor@xxxxxxxxx  Tue Apr 10 08:34:50 2018
From: Nathan Chancellor <natechancellor@xxxxxxxxx>
Date: Mon,  9 Apr 2018 18:21:50 -0700
Subject: virtio_net: check return value of skb_to_sgvec in one more location
To: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, stable@xxxxxxxxxxxxxxx
Cc: Nathan Chancellor <natechancellor@xxxxxxxxx>, "Jason A . Donenfeld" <Jason@xxxxxxxxx>, Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx>, "Michael S. Tsirkin" <mst@xxxxxxxxxx>, Jason Wang <jasowang@xxxxxxxxxx>, "David S . Miller" <davem@xxxxxxxxxxxxx>
Message-ID: <20180410012150.6573-10-natechancellor@xxxxxxxxx>

From: Nathan Chancellor <natechancellor@xxxxxxxxx>

Kernels that do not have f6b10209b90d ("virtio-net: switch to use
build_skb() for small buffer") will have an extra call to skb_to_sgvec
that is not handled by e2fcad58fd23 ("virtio_net: check return value of
skb_to_sgvec always"). Since the former does not appear to be stable
material, just fix the call up directly.

Cc: Jason A. Donenfeld <Jason@xxxxxxxxx>
Cc: Sergei Shtylyov <sergei.shtylyov@xxxxxxxxxxxxxxxxxx>
Cc: "Michael S. Tsirkin" <mst@xxxxxxxxxx>
Cc: Jason Wang <jasowang@xxxxxxxxxx>
Cc: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Nathan Chancellor <natechancellor@xxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
 drivers/net/virtio_net.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -529,7 +529,12 @@ static int add_recvbuf_small(struct virt
 	hdr = skb_vnet_hdr(skb);
 	sg_init_table(rq->sg, 2);
 	sg_set_buf(rq->sg, hdr, vi->hdr_len);
-	skb_to_sgvec(skb, rq->sg + 1, 0, skb->len);
+
+	err = skb_to_sgvec(skb, rq->sg + 1, 0, skb->len);
+	if (unlikely(err < 0)) {
+		dev_kfree_skb(skb);
+		return err;
+	}
 
 	err = virtqueue_add_inbuf(rq->vq, rq->sg, 2, skb, gfp);
 	if (err < 0)


Patches currently in stable-queue which might be from natechancellor@xxxxxxxxx are

queue-4.9/ipsec-check-return-value-of-skb_to_sgvec-always.patch
queue-4.9/rxrpc-check-return-value-of-skb_to_sgvec-always.patch
queue-4.9/virtio_net-check-return-value-of-skb_to_sgvec-always.patch
queue-4.9/virtio_net-check-return-value-of-skb_to_sgvec-in-one-more-location.patch



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