[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [qemu-xen staging-4.11] net: ignore packet size greater than INT_MAX
commit b697c0aecbf9bc8bdb4f1bf0ea92e6a8fb258094 Author: Jason Wang <jasowang@xxxxxxxxxx> AuthorDate: Wed May 30 13:16:36 2018 +0800 Commit: Anthony PERARD <anthony.perard@xxxxxxxxxx> CommitDate: Mon Apr 1 16:03:25 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 0719358d03..14cbb9e1ed 100644 --- a/net/net.c +++ b/net/net.c @@ -729,10 +729,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#staging-4.11 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |