[Spice-devel] [PATCH spice-gtk 0/5] RFC: Improve handling of large clipboard data

Marc-André Lureau marcandre.lureau at gmail.com
Wed Nov 6 13:25:07 PST 2013


From: Marc-André Lureau <marcandre.lureau at redhat.com>

Hi,

It's quite easy to crash a spice-gtk client when a clipboard operation
take large data buffers. There are several ways this can go wrong (2
ways client side, 2 ways guest side), from what I have found, gdk &
glib are mostly safe (at least on win32 backend, after gbo 711546 and
711553 are fixed).

However, it would be nice to somehow prevent large clipboard
operations, so I propose the following patches. They will also need a
few vdagent changes to deal with the proposed MAX_CLIPBOARD message.

An extra would be to make dos2unix function OOM safe, by getting rid
of GString. I have not done that, since the max-clipboard limit should
be sufficient in reasonable cases, but this will be an easy
supplement.

Marc-André Lureau (5):
  Block sending clipboard data > max-clipboard
  Add SPICE_MAX_CLIPBOARD environment variable
  main: use self for main channel variable
  main: simplify usage of VD_AGENT_HAS_CAPABILITY
  main: send max-clipboard to agent

 gtk/channel-main.c      | 144 ++++++++++++++++++++++++++++++++----------------
 gtk/spice-gtk-session.c |   9 ++-
 2 files changed, 104 insertions(+), 49 deletions(-)

-- 
1.8.3.1



More information about the Spice-devel mailing list