qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-8.2] ui/vnc-clipboard: fix inflate_buffer
@ 2023-11-22 12:58 Fiona Ebner
  2023-11-22 13:06 ` Marc-André Lureau
  0 siblings, 1 reply; 10+ messages in thread
From: Fiona Ebner @ 2023-11-22 12:58 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-stable, marcandre.lureau, kraxel, mcascell

Commit d921fea338 ("ui/vnc-clipboard: fix infinite loop in
inflate_buffer (CVE-2023-3255)") removed this hunk, but it is still
required, because it can happen that stream.avail_in becomes zero
before coming across a return value of Z_STREAM_END in the loop.

This fixes the host->guest direction of the clipboard with noVNC and
TigerVNC as clients.

Fixes: d921fea338 ("ui/vnc-clipboard: fix infinite loop in inflate_buffer (CVE-2023-3255)")
Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
 ui/vnc-clipboard.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/ui/vnc-clipboard.c b/ui/vnc-clipboard.c
index c759be3438..124b6fbd9c 100644
--- a/ui/vnc-clipboard.c
+++ b/ui/vnc-clipboard.c
@@ -69,6 +69,11 @@ static uint8_t *inflate_buffer(uint8_t *in, uint32_t in_len, uint32_t *size)
         }
     }
 
+    *size = stream.total_out;
+    inflateEnd(&stream);
+
+    return out;
+
 err_end:
     inflateEnd(&stream);
 err:
-- 
2.39.2




^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-12-06  9:00 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-22 12:58 [PATCH for-8.2] ui/vnc-clipboard: fix inflate_buffer Fiona Ebner
2023-11-22 13:06 ` Marc-André Lureau
2023-11-22 13:25   ` Fiona Ebner
2023-11-23  6:52     ` Marc-André Lureau
2023-11-23  8:46       ` Fiona Ebner
2023-11-27  9:15         ` Marc-André Lureau
2023-11-27 10:51           ` Fiona Ebner
2023-11-28 10:52             ` Marc-André Lureau
2023-12-04  7:30               ` Marc-André Lureau
2023-12-06  8:59                 ` Fiona Ebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).