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

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



commit 91c37190ff97fb70629cad517698d3aaec064905
Author:     Jason Wang <jasowang@xxxxxxxxxx>
AuthorDate: Wed May 30 13:16:36 2018 +0800
Commit:     Anthony PERARD <anthony.perard@xxxxxxxxxx>
CommitDate: Mon Apr 1 17:09:57 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 0e28099554..5b93527618 100644
--- a/net/net.c
+++ b/net/net.c
@@ -718,10 +718,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.10

_______________________________________________
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®.