Commit Graph

1787 Commits

Author SHA1 Message Date
Christian Ruppert
58195c1951 Require alsa only with --enable-client
Hey guys,

the alsa libraries/header seem to be required only when configured with
--enable-client so I wrote a patch to make configure respect it.

--
Regards,
Christian Ruppert

From 53683cc75ba092799f856f710cb45b2aacfb6123 Mon Sep 17 00:00:00 2001
From: Christian Ruppert <idl0r@gentoo.org>
Date: Sun, 3 Nov 2013 18:36:26 +0100
Subject: [PATCH] Require alsa only with --enable-client
2013-11-04 12:02:16 +01:00
Christophe Fergeau
8af6190096 Fix buffer overflow when decrypting client SPICE ticket
reds_handle_ticket uses a fixed size 'password' buffer for the decrypted
password whose size is SPICE_MAX_PASSWORD_LENGTH. However,
RSA_private_decrypt which we call for the decryption expects the
destination buffer to be at least RSA_size(link->tiTicketing.rsa)
bytes long. On my spice-server build, SPICE_MAX_PASSWORD_LENGTH
is 60 while RSA_size() is 128, so we end up overflowing 'password'
when using long passwords (this was reproduced using the string:
'fullscreen=1proxy=#enter proxy here; e.g spice_proxy = http://[proxy]:[port]'
as a password).

When the overflow occurs, QEMU dies with:
*** stack smashing detected ***: qemu-system-x86_64 terminated

This commit ensures we use a corectly sized 'password' buffer,
and that it's correctly nul-terminated so that we can use strcmp
instead of strncmp. To keep using strncmp, we'd need to figure out
which one of 'password' and 'taTicket.password' is the smaller buffer,
and use that size.

This fixes rhbz#999839
2013-10-30 10:40:50 +01:00
Christophe Fergeau
ef9a8bf053 Remove tunneling support
It's depending on an unmaintained package (slirp), and I don't
think anyone uses that code. It's not tested upstream nor in fedora,
so let's remove it.
2013-10-28 11:12:27 +01:00
Christophe Fergeau
1b6ced7dda Silence gcc false positive with -Wuninitialized
Some versions of gcc warn about:
red_channel.c: In function 'red_channel_client_wait_outgoing_item':
red_channel.c:2331: error: 'end_time' may be used uninitialized in this function [-Wuninitialized]
red_channel.c: In function 'red_channel_client_wait_pipe_item_sent':
red_channel.c:2363: error: 'end_time' may be used uninitialized in this function [-Wuninitialized]
red_channel.c: In function 'red_channel_wait_all_sent':
red_channel.c:2401: error: 'end_time' may be used uninitialized in this function [-Wuninitialized]

This is a false positive as end_time is unitialized when timeout is -1, and
we will only try to use end_time if timeout is not -1.

This commit initializes end_time to UINT64_MAX to avoid that warning. As
the test involving end_time will never be reached, we ensure it's always
TRUE so that it would be a noop even if it was reached.
2013-10-28 11:12:20 +01:00
Axel Lin
56e7876d8f red_tunnel_worker: Fix build error due to missing monitor_latency argument
Fix missing monitor_latency argument in red_channel_client_create call.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
2013-10-18 15:12:50 +02:00
Christophe Fergeau
f0336ac832 Use latest warnings.m4 from gnulib
This fixes at least some issues when building with clang
2013-10-10 11:20:08 +02:00
Christophe Fergeau
ceb672bf85 Use hardened linker flags if available
This commit reuse several macros from libvirt to test for
support for "-Wl,-z -Wl,relro", "-Wl,-z -Wl,now" and
"-Wl,--no-copy-dt-needed-entries", and use them if available.
2013-10-10 11:17:52 +02:00
Christophe Fergeau
f78f1ae61b Don't ignore all of m4/ in .gitignore
m4/ contains several files tracked in git, so we should not ignore
the whole directory.
2013-10-10 11:17:17 +02:00
Christophe Fergeau
c9ea4538e2 Fix PlaybackeCommand typo 2013-10-09 19:03:37 +02:00
Jeremy White
b634009bf0 Fix an overlooked x11 client case.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2013-10-09 19:03:37 +02:00
Marc-André Lureau
6e92dcbbba reds: remove dead code 2013-10-08 19:57:00 +02:00
Christophe Fergeau
edfb16a55d reds: Fix 'asyc' typo 2013-10-08 19:07:44 +02:00
Christophe Fergeau
df96538e1f Fix 'recive' typo throughout the code base
'receive' was mispelt 'recive' in multiple places.
2013-10-08 19:07:42 +02:00
Christophe Fergeau
394fd0e6b7 Namespace RECEIVE_BUF_SIZE 2013-10-08 19:07:41 +02:00
Marc-André Lureau
b18d867b31 server: handle red_get_surface_cmd() error explicitely
Don't ignore red_get_surface_cmd() error, and explicitely interrupt and
free cmd before processing.
2013-10-07 16:33:21 +02:00
Marc-André Lureau
1f12fa72cc server: plug some leaks on error
Plug what looks like memory leaks, that could be potentially be
triggered by a misbehaving guest.
2013-10-07 16:33:21 +02:00
Marc-André Lureau
3bb7db9c5d server: inputs s/relase/release 2013-10-07 16:33:20 +02:00
Marc-André Lureau
2d28da3c17 server: release all pressed keys on client disconnect
Releasing modifiers keys unconditionally on disconnect leads to
unexpected guest wakeups. To improve the situation, the server can
release only the pressed keys, which will prevent the wakeup in most
cases.

Furthermore, it's not sufficient to release only the modifiers keys.
Any key should be released on client disconnect to avoid sticky key
press across connections.

https://bugzilla.redhat.com/show_bug.cgi?id=871240
2013-10-07 16:33:20 +02:00
Marc-André Lureau
fe0941fb02 server: mark deprecated symbols 2013-10-07 16:33:20 +02:00
Marc-André Lureau
e93b2bb188 server/tests: avoid using deprecated symbols 2013-10-07 16:33:20 +02:00
Marc-André Lureau
1d18b7e98a server: set dispatcher before calling attache_worker
This allows to call spice_qxl_add_memslot during attache_worker(), like
done in the tests.
2013-10-07 16:33:20 +02:00
Marc-André Lureau
961fa77365 Update spice-common 2013-10-07 16:32:06 +02:00
Marc-André Lureau
30783c8e59 server: remove memslot unused functions 2013-10-01 16:23:59 +02:00
Marc-André Lureau
1237b50651 cleanup: remove GITVERSION
This file is unneeded since d986fb46
2013-09-30 17:22:26 +02:00
Marc-André Lureau
9a485b64ea server: remove unused fill_rects_clip
Unused since 62d0c076eb.
2013-09-30 13:58:47 +02:00
Marc-André Lureau
b2b3243031 spicec: disable stencil test with primary fbo
The primary buffer doesn't use stencil test. However, this should be
explicitely disabled, since the canvas might change stencil state, and
this will affect primary stencil buffer, making some of further update
operations clipped in unwanted ways.
2013-09-30 02:19:51 +02:00
Marc-André Lureau
37548f17e4 spicec: use pre/post copy
Ensure the GL state is appropriate for calling GCanvas::copy_pixels.
2013-09-30 02:19:51 +02:00
Marc-André Lureau
c2b1c0e7f3 spicec: add sw canvas diff check
Setting CHECKDIFF=1 environment variable will compare the rendering of
the selected canvas with a software canvas. This is useful for debugging
some rendering issues, however it is far from being perfect, since it's
not able to tell whether one or the other is actually faulty. It's a
strong indication though of which operations are incorrect.

Ideally, all operations should be checked, however, a few of them are
disabled by default because they fail all the time, and it looks like
pixman is not very accurate for blending/compositing (at least visually,
it seems gl has better rendering)
2013-09-30 02:19:51 +02:00
Marc-André Lureau
c3d6f0e1df spicec: do not abort if cache error 2013-09-30 02:19:51 +02:00
Marc-André Lureau
e67caa8516 spicec: add SPICE_NOGRAB
Similar to spice-gtk, disable mouse and keyboard grab (useful when
running under a debugger)
2013-09-30 02:19:51 +02:00
Marc-André Lureau
d524047400 spicec: remove dead GL code 2013-09-30 02:19:51 +02:00
Marc-André Lureau
a2be67cbfa spicec: use doublebuffer for opengl
This visually reduces glitches without noticeable speed difference.

It's also the traditionnal way of doing opengl.
2013-09-30 02:19:51 +02:00
Marc-André Lureau
fe72894bb8 spicec: fix non-doublebuffer drawing
First, context must set it, then Draw/ReadBuffer must be set to FRONT,
and then explicit Flush is needed.

This patch is mostly for future reference, it is mostly discarded in
following patch using double-buffer.
2013-09-30 02:19:51 +02:00
Marc-André Lureau
c7d1024d97 spicec: use standard opengl 3.0 framebuffer 2013-09-30 02:19:51 +02:00
Marc-André Lureau
862bb2cd07 spicec: refresh the display after display resize 2013-09-30 02:19:51 +02:00
Marc-André Lureau
0ca7704a5a spicec: warn when throwing exception
This helps to identify the code location of exception
2013-09-30 02:19:51 +02:00
Marc-André Lureau
788418db65 update spice-common 2013-09-30 02:19:51 +02:00
Yonit Halperin
90a4761249 red_worker: disconnect the channel instead of shutdown in case of a blocking method failure
rhbz#1004443

The methods that trigger waitings on the client pipe require that
the waiting will succeed in order to continue, or otherwise, that
all the living pipe items will be released (e.g., when
we must destroy a surface, we need that all its related pipe items will
be released). Shutdown of the socket will eventually trigger
red_channel_client_disconnect (*), which will empty the pipe. However,
if the blocking method failed, we need to empty the pipe synchronously.
It is not safe(**) to call red_channel_client_disconnect from ChannelCbs
, but all the blocking calls in red_worker are done from callbacks that
are triggered from the device.
To summarize, calling red_channel_client_disconnect instead of calling
red_channel_client_shutdown will immediately release all the pipe items that are
held by the channel client (by calling red_channel_client_pipe_clear).
If red_clear_surface_drawables_from_pipe timeouts,
red_channel_client_disconnect will make sure that the surface we wish to
release is not referenced by any pipe-item.

(*) After a shutdown of a socket, we expect that later, when
red_peer_handle_incoming is called, it will encounter a socket
error and will call the channel's on_error callback which calls
red_channel_client_disconnect.

(**) I believe it was not safe before commit 2d2121a170 (before adding ref
count to ChannelClient). However, I think it might still be unsafe, because
red_channel_client_disconnect sets rcc->stream to NULL, and rcc->stream
may be referred later inside a red_channel_client method unsafely. So instead
of checking if (stream != NULL) after calling callbacks, we try to avoid
calling red_channel_client_disconnect from callbacks.
2013-09-26 13:58:43 -04:00
Yonit Halperin
bcf9e64f13 red_channel: cleanup of red_channel_client blocking methods
(1) receive timeout as a parameter.
(2) add a return value and pass the handling
    of failures to the calling routine.
2013-09-26 10:48:40 -04:00
Yonit Halperin
6c2ff9864d red_worker: cleanup red_clear_surface_drawables_from_pipes
(1) merge 'force' and 'wait_for_outgoing_item' to one parameter.
    'wait_for_outgoing_item' is a derivative of 'force'.
(2) move the call to red_wait_outgoing_item to red_clear_surface_drawables_from_pipe
2013-09-26 10:48:40 -04:00
Marc-André Lureau
ced4f1adfd build-sys: fix some automake warning
client/Makefile.am:199: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
server/tests/Makefile.am:3: warning: 'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
2013-09-17 19:41:27 +02:00
Dunrong Huang
6f4d2c8afb Fix _FORTIFY_SOURCE redefine error
If the _FORTIFY_SOURCE has been already defined, we shouldn't redefine
it, or it will raise a build error as below:

In file included from agent-msg-filter.c:21:0:
../config.h:17:0: error: "_FORTIFY_SOURCE" redefined [-Werror]
agent-msg-filter.c:1:0: note: this is the location of the previous definition

Suggested-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
2013-09-10 07:59:54 +02:00
Christophe Fergeau
7989644092 red_parse_qxl: Change spice_error() to spice_warning()
After eb09c25c, red_parse_qxl.c still has some spice_error() which
will kill the server even though the code is trying to return an error
when the spice_error() is hit.
This commit replaces these occurrences with a spice_warning() which
will not kill spice-server.
2013-09-02 18:13:04 +02:00
Uri Lublin
eb09c25c62 server: bitmap_consistent: replace spice_error with spice_warning
bitmap_consistent should return true or false.
Currently it aborts instead of returning false, due to spice_error.
Replacing spice_error with spice_warning, provides information and returns
false, as expected.

This fixes Fedora bz#997932
2013-09-02 13:31:20 +03:00
Alon Levy
d867788044 client: add some missing USE_GUI define guards 2013-08-29 16:23:57 +03:00
Yonit Halperin
d0a1346fda red_worker: fix call to dump_bitmap (too many args) 2013-08-22 16:12:07 -04:00
Yonit Halperin
93b88a73f3 spice_bitmap_utils: fix dump_bitmap 2013-08-22 16:09:26 -04:00
Yonit Halperin
ed1f70c6d1 main_channel: monitoring client connection status
rhbz#994175

Start monitoring if the client connection is alive after completing
the bit-rate test.
2013-08-14 13:36:30 -04:00
Yonit Halperin
c8b808bb82 red_channel: add option to monitor whether a channel client is alive
rhbz#994175

When a client connection is closed surprisingly (i.e., without a FIN
segment), we cannot identify it by a socket error (which is the only
way by which we identified disconnections so far).
This patch allows a channel client to periodically check the state of
the connection and identify surprise disconnections.
2013-08-14 13:35:10 -04:00
Yonit Halperin
d1e7142a0f red_channel: add on_input callback for tracing incoming bytes
The callback will be used in the next patch.
2013-08-14 11:08:17 -04:00