Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Alexander_Naumov:SLE-12:Update
spice
0003-Define-a-constant-to-limit-data-from-guest...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0003-Define-a-constant-to-limit-data-from-guest.patch of Package spice
From 0205a6ce63f50af9eda03f14d93b3a2517c42fae Mon Sep 17 00:00:00 2001 From: Frediano Ziglio <fziglio@redhat.com> Date: Tue, 8 Sep 2015 11:58:11 +0100 Subject: [PATCH 03/19] Define a constant to limit data from guest. This limit will prevent guest trying to do nasty things and DoS to host. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> --- server/red_parse_qxl.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c index 5b1befa..3ffa57b 100644 --- a/server/red_parse_qxl.c +++ b/server/red_parse_qxl.c @@ -21,11 +21,22 @@ #include <stdbool.h> #include <inttypes.h> +#include <glib.h> #include "common/lz_common.h" #include "red_common.h" #include "red_memslots.h" #include "red_parse_qxl.h" +/* Max size in bytes for any data field used in a QXL command. + * This will for example be useful to prevent the guest from saturating the + * host memory if it tries to send overlapping chunks. + * This value should be big enough for all requests but limited + * to 32 bits. Even better if it fits on 31 bits to detect integer overflows. + */ +#define MAX_DATA_CHUNK 0x7ffffffflu + +G_STATIC_ASSERT(MAX_DATA_CHUNK <= G_MAXINT32); + #if 0 static void hexdump_qxl(RedMemSlotInfo *slots, int group_id, QXLPHYSICAL addr, uint8_t bytes) -- 2.1.4
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor