forked from openembedded/meta-openembedded
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
freerdp: fix CVE-2022-39316/39318/39319
Source: meta-openembedded MR: 126092 Type: Integration Disposition: Merged from meta-openembedded ChangeID: 6bd0340 Description: Signed-off-by: Chee Yang Lee <[email protected]> Signed-off-by: Armin Kuster <[email protected]> Signed-off-by: Jeremy A. Puhlman <[email protected]>
- Loading branch information
1 parent
5eae978
commit 93c35a4
Showing
3 changed files
with
96 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
meta-oe/recipes-support/freerdp/freerdp/CVE-2022-39316.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
https://github.com/FreeRDP/FreeRDP/commit/e865c24efc40ebc52e75979c94cdd4ee2c1495b0 | ||
CVE: CVE-2022-39316 | ||
Upstream-Status: Backport | ||
Signed-off-by: Lee Chee Yang <[email protected]> | ||
|
||
From e865c24efc40ebc52e75979c94cdd4ee2c1495b0 Mon Sep 17 00:00:00 2001 | ||
From: akallabeth <[email protected]> | ||
Date: Thu, 13 Oct 2022 09:09:28 +0200 | ||
Subject: [PATCH] Added missing length checks in zgfx_decompress_segment | ||
|
||
(cherry picked from commit 64716b335858109d14f27b51acc4c4d71a92a816) | ||
--- | ||
libfreerdp/codec/zgfx.c | 11 +++++++---- | ||
1 file changed, 7 insertions(+), 4 deletions(-) | ||
|
||
diff --git a/libfreerdp/codec/zgfx.c b/libfreerdp/codec/zgfx.c | ||
index 20fbd354571..e260aa6e28a 100644 | ||
--- a/libfreerdp/codec/zgfx.c | ||
+++ b/libfreerdp/codec/zgfx.c | ||
@@ -230,19 +230,19 @@ static BOOL zgfx_decompress_segment(ZGFX_CONTEXT* zgfx, wStream* stream, size_t | ||
BYTE* pbSegment; | ||
size_t cbSegment; | ||
|
||
- if (!zgfx || !stream) | ||
+ if (!zgfx || !stream || (segmentSize < 2)) | ||
return FALSE; | ||
|
||
cbSegment = segmentSize - 1; | ||
|
||
- if ((Stream_GetRemainingLength(stream) < segmentSize) || (segmentSize < 1) || | ||
- (segmentSize > UINT32_MAX)) | ||
+ if ((Stream_GetRemainingLength(stream) < segmentSize) || (segmentSize > UINT32_MAX)) | ||
return FALSE; | ||
|
||
Stream_Read_UINT8(stream, flags); /* header (1 byte) */ | ||
zgfx->OutputCount = 0; | ||
pbSegment = Stream_Pointer(stream); | ||
- Stream_Seek(stream, cbSegment); | ||
+ if (!Stream_SafeSeek(stream, cbSegment)) | ||
+ return FALSE; | ||
|
||
if (!(flags & PACKET_COMPRESSED)) | ||
{ | ||
@@ -346,6 +346,9 @@ static BOOL zgfx_decompress_segment(ZGFX_CONTEXT* zgfx, wStream* stream, size_t | ||
if (count > sizeof(zgfx->OutputBuffer) - zgfx->OutputCount) | ||
return FALSE; | ||
|
||
+ if (count > zgfx->cBitsRemaining / 8) | ||
+ return FALSE; | ||
+ | ||
CopyMemory(&(zgfx->OutputBuffer[zgfx->OutputCount]), zgfx->pbInputCurrent, | ||
count); | ||
zgfx_history_buffer_ring_write(zgfx, zgfx->pbInputCurrent, count); |
41 changes: 41 additions & 0 deletions
41
meta-oe/recipes-support/freerdp/freerdp/CVE-2022-39318-39319.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
https://github.com/FreeRDP/FreeRDP/commit/80adde17ddc4b596ed1dae0922a0c54ab3d4b8ea | ||
CVE: CVE-2022-39318 CVE-2022-39319 | ||
Upstream-Status: Backport | ||
Signed-off-by: Lee Chee Yang <[email protected]> | ||
|
||
From 80adde17ddc4b596ed1dae0922a0c54ab3d4b8ea Mon Sep 17 00:00:00 2001 | ||
From: akallabeth <[email protected]> | ||
Date: Thu, 13 Oct 2022 08:27:41 +0200 | ||
Subject: [PATCH] Fixed division by zero in urbdrc | ||
|
||
(cherry picked from commit 731f8419d04b481d7160de1f34062d630ed48765) | ||
--- | ||
channels/urbdrc/client/libusb/libusb_udevice.c | 12 +++++++++--- | ||
1 file changed, 9 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/channels/urbdrc/client/libusb/libusb_udevice.c b/channels/urbdrc/client/libusb/libusb_udevice.c | ||
index 505c31d7b55..ef87f195f38 100644 | ||
--- a/channels/urbdrc/client/libusb/libusb_udevice.c | ||
+++ b/channels/urbdrc/client/libusb/libusb_udevice.c | ||
@@ -1221,12 +1221,18 @@ static int libusb_udev_isoch_transfer(IUDEVICE* idev, URBDRC_CHANNEL_CALLBACK* c | ||
if (!Buffer) | ||
Stream_Seek(user_data->data, (NumberOfPackets * 12)); | ||
|
||
- iso_packet_size = BufferSize / NumberOfPackets; | ||
- iso_transfer = libusb_alloc_transfer(NumberOfPackets); | ||
+ if (NumberOfPackets > 0) | ||
+ { | ||
+ iso_packet_size = BufferSize / NumberOfPackets; | ||
+ iso_transfer = libusb_alloc_transfer((int)NumberOfPackets); | ||
+ } | ||
|
||
if (iso_transfer == NULL) | ||
{ | ||
- WLog_Print(urbdrc->log, WLOG_ERROR, "Error: libusb_alloc_transfer."); | ||
+ WLog_Print(urbdrc->log, WLOG_ERROR, | ||
+ "Error: libusb_alloc_transfer [NumberOfPackets=%" PRIu32 ", BufferSize=%" PRIu32 | ||
+ " ]", | ||
+ NumberOfPackets, BufferSize); | ||
async_transfer_user_data_free(user_data); | ||
return -1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters