Re: [Spice-devel] [PATCH spice-gtk v2 2/2] New file transfer API

2015-10-06 Thread Pavel Grunt
On Tue, 2015-10-06 at 11:55 -0500, Jonathon Jongsma wrote: > On Tue, 2015-10-06 at 15:33 +0200, Pavel Grunt wrote: > > Hi Jonathon, > > > > thanks for the work, the user should have a way to cancel & monitor the file > > transfer progress. > > > > Ack from me, just a few comments below. > > > >

Re: [Spice-devel] [PATCH spice-gtk v2 0/4] Public include cleanups

2015-10-06 Thread Pavel Grunt
On Tue, 2015-10-06 at 15:23 -0500, Jonathon Jongsma wrote: > On Fri, 2015-09-25 at 08:53 -0500, Jonathon Jongsma wrote: > > On Fri, 2015-09-25 at 10:51 +0200, Christophe Fergeau wrote: > > > On Thu, Sep 24, 2015 at 05:20:25PM -0500, Jonathon Jongsma wrote: > > > > This is a second approach suggeste

Re: [Spice-devel] [PATCH spice-gtk v2 0/4] Public include cleanups

2015-10-06 Thread Jonathon Jongsma
On Fri, 2015-09-25 at 08:53 -0500, Jonathon Jongsma wrote: > On Fri, 2015-09-25 at 10:51 +0200, Christophe Fergeau wrote: > > On Thu, Sep 24, 2015 at 05:20:25PM -0500, Jonathon Jongsma wrote: > > > This is a second approach suggested by Marc-Andre to fix up some of the > > > issues > > > with circ

[Spice-devel] [PATCH spice-gtk v3 2/2] New file transfer API

2015-10-06 Thread Jonathon Jongsma
There were several shortcomings to the existing file transfer API, particularly in terms of monitoring ongoing file transfers. The major issue is that spice_main_file_copy_async() allows you to pass an array of files, but the progress callback does not provide a way to identify which file the callb

[Spice-devel] [PATCH spice-gtk v3 1/2] Fix progress monitoring in spice_main_file_copy_async

2015-10-06 Thread Jonathon Jongsma
spice_main_file_copy_async() allows you to pass a NULL-terminated array of files to transfer to the guest. It also allows you to pass a progress_callback function to monitor the progress of the transfer, but this progress callback is called separately for each file that is transferred, and there ar

Re: [Spice-devel] [PATCH spice-gtk v2 2/2] New file transfer API

2015-10-06 Thread Jonathon Jongsma
On Tue, 2015-10-06 at 15:33 +0200, Pavel Grunt wrote: > Hi Jonathon, > > thanks for the work, the user should have a way to cancel & monitor the file > transfer progress. > > Ack from me, just a few comments below. > > On Mon, 2015-10-05 at 13:39 -0500, Jonathon Jongsma wrote: > > There were sev

[Spice-devel] Announcing spice 0.12.6

2015-10-06 Thread Christophe Fergeau
Hey everyone, At long last, I've rolled out a new spice 0.12.6 release. Major changes in 0.12.6: * Removed spicec client code, it has been superseded by remote-viewer and other spice-gtk based clients * Unix socket support * LZ4 support * Let clients specify their prefe

Re: [Spice-devel] [PATCH spice-gtk v2 2/2] New file transfer API

2015-10-06 Thread Pavel Grunt
Hi Jonathon, thanks for the work, the user should have a way to cancel & monitor the file transfer progress. Ack from me, just a few comments below. On Mon, 2015-10-05 at 13:39 -0500, Jonathon Jongsma wrote: > There were several shortcomings to the existing file transfer API, > particularly in t

Re: [Spice-devel] [PATCH 00/19] CVE-2015-5260 and CVE-2015-5261 related fixes

2015-10-06 Thread Christophe Fergeau
On Tue, Oct 06, 2015 at 06:38:06AM -0400, Frediano Ziglio wrote: > > > > See https://access.redhat.com/security/cve/CVE-2015-5260, > > https://access.redhat.com/security/cve/CVE-2015-5261 and > > http://openwall.com/lists/oss-security/2015/10/06/4 for some > > details on the security problems disc

Re: [Spice-devel] [PATCH 00/19] CVE-2015-5260 and CVE-2015-5261 related fixes

2015-10-06 Thread Frediano Ziglio
> > See https://access.redhat.com/security/cve/CVE-2015-5260, > https://access.redhat.com/security/cve/CVE-2015-5261 and > http://openwall.com/lists/oss-security/2015/10/06/4 for some > details on the security problems discovered. > > These patches were already be sended to different distribution

[Spice-devel] [PATCH 13/19] Prevent memory leak if red_get_data_chunks_ptr fails

2015-10-06 Thread Frediano Ziglio
Free linked list if client tries to do nasty things Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 31 --- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c index

[Spice-devel] [PATCH 05/19] Check properly surface to be created

2015-10-06 Thread Frediano Ziglio
Check format is valid. Check stride is at least the size of required bytes for a row. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/server/red_parse_q

[Spice-devel] [PATCH 08/19] Fix race condition on red_get_clip_rects

2015-10-06 Thread Frediano Ziglio
Do not read multiple time an array size that can be changed. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c index 40c1c99..a9f3ca1

[Spice-devel] [PATCH 07/19] Prevent 32 bit integer overflow in bitmap_consistent

2015-10-06 Thread Frediano Ziglio
The overflow may lead to buffer overflow as the row size computed from width (bitmap->x) can be bigger than the size in bytes (bitmap->stride). This can make spice-server accept the invalid sizes. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 7 ---

[Spice-devel] [PATCH 06/19] Fix buffer reading overflow

2015-10-06 Thread Frediano Ziglio
Not security risk as just for read. However, this could be used to attempt integer overflows in the following lines. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/server/red_pars

[Spice-devel] [PATCH 14/19] Prevent DoS from guest trying to allocate too much data on host for chunks

2015-10-06 Thread Frediano Ziglio
Limit number of chunks to a given amount to avoid guest trying to allocate too much memory. Using circular or nested chunks lists guest could try to allocate huge amounts of memory. Considering the list can be infinite and guest can change data this also prevents strange security attacks from guest

[Spice-devel] [PATCH 01/19] worker: validate correctly surfaces

2015-10-06 Thread Frediano Ziglio
Do not just give warning and continue to use an invalid index into an array. Resolves: CVE-2015-5260 Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_worker.c | 33 ++--- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/serve

[Spice-devel] [PATCH 03/19] Define a constant to limit data from guest.

2015-10-06 Thread Frediano Ziglio
This limit will prevent guest trying to do nasty things and DoS to host. Signed-off-by: Frediano Ziglio --- 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

[Spice-devel] [PATCH 17/19] Avoid race condition copying segments in red_get_path

2015-10-06 Thread Frediano Ziglio
The guest can attempt to increase the number of segments while spice-server is reading them. Make sure we don't copy more then the allocated segments. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[Spice-devel] [PATCH 04/19] Fix some integer overflow causing large memory allocations

2015-10-06 Thread Frediano Ziglio
Prevent integer overflow when computing image sizes. Image index computations are done using 32 bit so this can cause easily security issues. MAX_DATA_CHUNK is larger than the virtual card limit, so this is not going to cause change in behaviours. Comparing size calculation results with MAX_DATA_CH

[Spice-devel] [PATCH 16/19] Make sure we can read QXLPathSeg structures

2015-10-06 Thread Frediano Ziglio
start pointer points to a QXLPathSeg structure. Before reading from the structure, make sure the structure is contained in the memory range checked. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)

[Spice-devel] [PATCH 09/19] Fix race in red_get_image

2015-10-06 Thread Frediano Ziglio
Do not read multiple times data from guest as this could be changed by other vcpu threads. This causes races and security problems if these data are used for buffer allocation or checks. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 18 ++--

[Spice-devel] [PATCH 19/19] Prevent leak if size from red_get_data_chunks don't match in red_get_image

2015-10-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio --- server/red_parse_qxl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c index 3ce4431..dd52602 100644 --- a/server/red_parse_qxl.c +++ b/server/red_parse_qxl.c @@ -526,6 +526,7 @@ static SpiceImage *red_get_im

[Spice-devel] [PATCH 10/19] Fix race condition in red_get_string

2015-10-06 Thread Frediano Ziglio
Do not read multiple time an array size that can be changed. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 15 +-- 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c index 5656bfb..

[Spice-devel] [PATCH 00/19] CVE-2015-5260 and CVE-2015-5261 related fixes

2015-10-06 Thread Frediano Ziglio
See https://access.redhat.com/security/cve/CVE-2015-5260, https://access.redhat.com/security/cve/CVE-2015-5261 and http://openwall.com/lists/oss-security/2015/10/06/4 for some details on the security problems discovered. These patches were already be sended to different distribution and updates ar

[Spice-devel] [PATCH 11/19] Fix integer overflow computing glyph_size in red_get_string

2015-10-06 Thread Frediano Ziglio
If bpp is int the formula can lead to weird overflows. width and height are uint16_t so the formula is: size_t = u16 * (u16 * int + const_int) / const_int; so it became size_t = (int) u16 * ((int) u16 * int + const_int) / const_int; However the (int) u16 * (int) u16 can then became negative

[Spice-devel] [PATCH 15/19] Fix some possible overflows in red_get_string for 32 bit

2015-10-06 Thread Frediano Ziglio
Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- server/red_parse_qxl.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/red_parse_qxl.c b/server/red_parse_qxl.c index 5513e82..f21bfa5 100644 --- a/server/red_parse_qxl.c +++ b/server/red_parse_qxl.

[Spice-devel] [PATCH 02/19] worker: avoid double free or double create of surfaces

2015-10-06 Thread Frediano Ziglio
A driver can overwrite surface state creating a surface with the same id of a previous one. Also can try to destroy surfaces that are not created. Both requests cause invalid internal states that could lead to crashes or memory corruptions. Signed-off-by: Frediano Ziglio --- server/red_worker.c

[Spice-devel] [PATCH 18/19] Prevent data_size to be set independently from data

2015-10-06 Thread Frediano Ziglio
There was not check for data_size field so one could set data to a small set of data and data_size much bigger than size of data leading to buffer overflow. Signed-off-by: Frediano Ziglio --- server/red_parse_qxl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/server/red_parse_qxl.c b/serv

[Spice-devel] [PATCH 12/19] Fix race condition in red_get_data_chunks_ptr

2015-10-06 Thread Frediano Ziglio
Do not read multiple times data from guest as this can be changed by other guest vcpus. This causes races and security problems if these data are used for buffer allocation or checks. Actually, the 'data' member can't change during read as it is just a pointer to a fixed array contained in qxl. Ho

Re: [Spice-devel] [PATCH spice-server] red_worker: Do not sent empty monitor config message

2015-10-06 Thread Pavel Grunt
On Mon, 2015-10-05 at 18:39 +0200, Christophe Fergeau wrote: > On Thu, Oct 01, 2015 at 05:19:23PM +0200, Pavel Grunt wrote: > > Resolves: > > https://bugzilla.redhat.com/show_bug.cgi?id=1061942 > > --- > >  server/red_worker.c | 10 ++ > >  1 file changed, 6 insertions(+), 4 deletions(-) > >

Re: [Spice-devel] [PATCH spice-gtk v2 1/2] Fix progress monitoring in spice_main_file_copy_async

2015-10-06 Thread Victor Toso
Hi, On Mon, Oct 05, 2015 at 01:39:54PM -0500, Jonathon Jongsma wrote: > spice_main_file_copy_async() allows you to pass a NULL-terminated array > of files to transfer to the guest. It also allows you to pass a > progress_callback function to monitor the progress of the transfer, but > this progres