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

[Xen-changelog] [qemu-xen stable-4.12] net: ignore packet size greater than INT_MAX



commit 8298beab13fa25e6edc8fdac6ef5c7924ef8578e
Author:     Jason Wang <jasowang@xxxxxxxxxx>
AuthorDate: Wed May 30 13:16:36 2018 +0800
Commit:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
CommitDate: Tue Apr 2 17:27:33 2019 +0100

    net: ignore packet size greater than INT_MAX
    
    There should not be a reason for passing a packet size greater than
    INT_MAX. It's usually a hint of bug somewhere, so ignore packet size
    greater than INT_MAX in qemu_deliver_packet_iov()
    
    CC: qemu-stable@xxxxxxxxxx
    Reported-by: Daniel Shapira <daniel@xxxxxxxxxxxxx>
    Reviewed-by: Michael S. Tsirkin <mst@xxxxxxxxxx>
    Signed-off-by: Jason Wang <jasowang@xxxxxxxxxx>
    (cherry picked from commit 1592a9947036d60dde5404204a5d45975133caf5)
---
 net/net.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/net/net.c b/net/net.c
index 2a3133990c..46db72811b 100644
--- a/net/net.c
+++ b/net/net.c
@@ -712,10 +712,15 @@ ssize_t qemu_deliver_packet_iov(NetClientState *sender,
                                 void *opaque)
 {
     NetClientState *nc = opaque;
+    size_t size = iov_size(iov, iovcnt);
     int ret;
 
+    if (size > INT_MAX) {
+        return size;
+    }
+
     if (nc->link_down) {
-        return iov_size(iov, iovcnt);
+        return size;
     }
 
     if (nc->receive_disabled) {
--
generated by git-patchbot for /home/xen/git/qemu-xen.git#stable-4.12

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.