Re: [Spice-devel] [PATCH] usbredirhost: host should not be marked as claimed on failure

2018-05-11 Thread Qiu Wenbo
This is a patch trying to fix a bug caused by usbredir. The problem is when usbredir failed to claim all interface of a USB device it won't set host->claimed to 0. After that, usbredirhost_release run by usbredirhost_close will detach kernel driver and do a device reset even some one is still u

Re: [Spice-devel] [PATCH] Revert "usbredir: Disconnect USB device asynchronously"

2018-05-11 Thread Qiu Wenbo
Yes. The situation can be easily reproduced by the patch below. We have noticed it usually happen on some thin clients (without the patch). Also, I can reproduce it on my desktop (latest version of Arch linux, ryzen 1600x) with debug build of qemu, spice-gtk, and usbredir with remote-viewer --s

Re: [Spice-devel] [PATCH spice-common] codegen: Removed unused get_type methods

2018-05-11 Thread Frediano Ziglio
> > On Wed, 2018-05-09 at 05:10 -0400, Frediano Ziglio wrote: > > > > > > On Sun, 2018-05-06 at 13:29 +0100, Frediano Ziglio wrote: > > > > Signed-off-by: Frediano Ziglio > > > > --- > > > > python_modules/ptypes.py | 9 - > > > > 1 file changed, 9 deletions(-) > > > > > > > > diff --g

Re: [Spice-devel] [PATCH spice-common] codegen: Removed unused get_type methods

2018-05-11 Thread Jonathon Jongsma
On Wed, 2018-05-09 at 05:10 -0400, Frediano Ziglio wrote: > > > > On Sun, 2018-05-06 at 13:29 +0100, Frediano Ziglio wrote: > > > Signed-off-by: Frediano Ziglio > > > --- > > > python_modules/ptypes.py | 9 - > > > 1 file changed, 9 deletions(-) > > > > > > diff --git a/python_modules/p

Re: [Spice-devel] [PATCH spice-common v3] build: Remove FIXME_SERVER_SMARTCARD hack

2018-05-11 Thread Frediano Ziglio
> > On 11/05/18 10:14, Eduardo Lima (Etrunko) wrote: > > When we remove the hacks in configure.ac and common/Makefile.am, two > > errors pop out: > > > > generated_server_demarshallers.c: In function > > ‘parse_msgc_smartcard_reader_add’: > > generated_server_demarshallers.c:1985:30: error: ‘mem_

Re: [Spice-devel] [PATCH spice-common] protocol: Use a typedef to specify stream_id type

2018-05-11 Thread Jonathon Jongsma
On Fri, 2018-05-11 at 17:56 +0200, Christophe de Dinechin wrote: > > On 10 May 2018, at 18:08, Jonathon Jongsma > > wrote: > > > > On Sat, 2018-05-05 at 16:43 +0100, Frediano Ziglio wrote: > > > This change does not affect generated code but make source more > > > readable. Also document in a sin

Re: [Spice-devel] [PATCH spice-common] protocol: Use a typedef to specify stream_id type

2018-05-11 Thread Christophe de Dinechin
> On 10 May 2018, at 18:08, Jonathon Jongsma wrote: > > On Sat, 2018-05-05 at 16:43 +0100, Frediano Ziglio wrote: >> This change does not affect generated code but make source more >> readable. Also document in a single location the range of this >> type. >> >> Signed-off-by: Frediano Ziglio

Re: [Spice-devel] [PATCH spice-common v2 2/3] Write a small test to test possible crash

2018-05-11 Thread Jonathon Jongsma
Acked-by: Jonathon Jongsma On Fri, 2018-05-11 at 08:39 +0100, Frediano Ziglio wrote: > This small test prove a that current generated demarshaller code > is not safe to integer overflows leading to buffer overflows. > Actually from a quick look at the protocol it seems that client > can't cause

Re: [Spice-devel] [PATCH spice-common v3] build: Remove FIXME_SERVER_SMARTCARD hack

2018-05-11 Thread Eduardo Lima (Etrunko)
On 11/05/18 10:14, Eduardo Lima (Etrunko) wrote: > When we remove the hacks in configure.ac and common/Makefile.am, two > errors pop out: > > generated_server_demarshallers.c: In function > ‘parse_msgc_smartcard_reader_add’: > generated_server_demarshallers.c:1985:30: error: ‘mem_size’ undeclared

[Spice-devel] [PATCH spice-common v3] build: Remove FIXME_SERVER_SMARTCARD hack

2018-05-11 Thread Eduardo Lima (Etrunko)
When we remove the hacks in configure.ac and common/Makefile.am, two errors pop out: generated_server_demarshallers.c: In function ‘parse_msgc_smartcard_reader_add’: generated_server_demarshallers.c:1985:30: error: ‘mem_size’ undeclared (first use in this function); did you mean ‘nw_size’? d

Re: [Spice-devel] [PATCH spice-common v2] build: Remove FIXME_SERVER_SMARTCARD hack

2018-05-11 Thread Eduardo Lima (Etrunko)
On 11/05/18 08:54, Frediano Ziglio wrote: >> >> When we remove the hacks in configure.ac and common/Makefile.am, two >> errors pop out: >> >> generated_server_demarshallers.c: In function >> ‘parse_msgc_smartcard_reader_add’: >> generated_server_demarshallers.c:1985:30: error: ‘mem_size’ undeclared

Re: [Spice-devel] [PATCH spice-common v2] build: Remove FIXME_SERVER_SMARTCARD hack

2018-05-11 Thread Frediano Ziglio
> > When we remove the hacks in configure.ac and common/Makefile.am, two > errors pop out: > > generated_server_demarshallers.c: In function > ‘parse_msgc_smartcard_reader_add’: > generated_server_demarshallers.c:1985:30: error: ‘mem_size’ undeclared (first > use in this function); did you mean ‘

Re: [Spice-devel] [PATCH spice-common 2/3] Write a small test to test possible crash

2018-05-11 Thread Frediano Ziglio
> > > > On Mon, 2018-03-19 at 10:06 +, Frediano Ziglio wrote: > > > This small test prove a that current generated demarshaller code > > > is not safe to integer overflows leading to buffer overflows. > > > Actually from a quick look at the protocol it seems that client > > > can't cause these

[Spice-devel] [PATCH spice-common v2 2/3] Write a small test to test possible crash

2018-05-11 Thread Frediano Ziglio
This small test prove a that current generated demarshaller code is not safe to integer overflows leading to buffer overflows. Actually from a quick look at the protocol it seems that client can't cause these overflows but server can quite easily at demonstrated by this test. Signed-off-by: Fredia