add fix for vnc clipboard
This fixes the host->guest direction with noNVC as a client (and likely others). Reported-by: Friedrich Weber <f.weber@proxmox.com> Signed-off-by: Fiona Ebner <f.ebner@proxmox.com> Tested-by: Friedrich Weber <f.weber@proxmox.com>
This commit is contained in:
		
							parent
							
								
									38726d3473
								
							
						
					
					
						commit
						df2cc786ee
					
				
							
								
								
									
										34
									
								
								debian/patches/extra/0010-ui-vnc-clipboard-fix-inflate_buffer.patch
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										34
									
								
								debian/patches/extra/0010-ui-vnc-clipboard-fix-inflate_buffer.patch
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,34 @@ | ||||
| From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||||
| From: Fiona Ebner <f.ebner@proxmox.com> | ||||
| Date: Wed, 22 Nov 2023 13:17:25 +0100 | ||||
| Subject: [PATCH] ui/vnc-clipboard: fix inflate_buffer | ||||
| 
 | ||||
| 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. | ||||
| 
 | ||||
| This fixes the host->guest direction with noNVC. | ||||
| 
 | ||||
| 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: | ||||
							
								
								
									
										1
									
								
								debian/patches/series
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										1
									
								
								debian/patches/series
									
									
									
									
										vendored
									
									
								
							| @ -7,6 +7,7 @@ extra/0006-Revert-Revert-graph-lock-Disable-locking-for-now.patch | ||||
| extra/0007-migration-states-workaround-snapshot-performance-reg.patch | ||||
| extra/0008-Revert-x86-acpi-workaround-Windows-not-handling-name.patch | ||||
| extra/0009-hw-ide-ahci-fix-legacy-software-reset.patch | ||||
| extra/0010-ui-vnc-clipboard-fix-inflate_buffer.patch | ||||
| bitmap-mirror/0001-drive-mirror-add-support-for-sync-bitmap-mode-never.patch | ||||
| bitmap-mirror/0002-drive-mirror-add-support-for-conditional-and-always-.patch | ||||
| bitmap-mirror/0003-mirror-add-check-for-bitmap-mode-without-bitmap.patch | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Fiona Ebner
						Fiona Ebner