From 1cddd4643ab276bb32f5632be4403c415a6491e9 Mon Sep 17 00:00:00 2001 From: Tobias Frost Date: Sun, 12 Nov 2023 12:44:19 +0100 Subject: [PATCH] Import fix for CVE-2022-39282 (Closes: #1021659) --- debian/changelog | 1 + debian/patches/0058-CVE-2022-39282.patch | 34 ++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 36 insertions(+) create mode 100644 debian/patches/0058-CVE-2022-39282.patch diff --git a/debian/changelog b/debian/changelog index 08d6d59..1bcaaa7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -11,6 +11,7 @@ freerdp2 (2.3.0+dfsg1-2+deb10u4) buster-security; urgency=medium - CVE-2022-39319 - Missing length validation in urbdrc channel - CVE-2022-39347 - Missing path sanitation with `drive` channel - CVE-2022-41877 - Missing input length validation in `drive` channel + * Import fix for CVE-2022-39282 (Closes: #1021659) * Previous upload had a typo in the CVE list: It was CVE 2023-40567 not CVE 2023-39357; fixing changelog entry. diff --git a/debian/patches/0058-CVE-2022-39282.patch b/debian/patches/0058-CVE-2022-39282.patch new file mode 100644 index 0000000..75acd76 --- /dev/null +++ b/debian/patches/0058-CVE-2022-39282.patch @@ -0,0 +1,34 @@ +From 60aac2abf0740dd36b62712fba91498fd6e055fe Mon Sep 17 00:00:00 2001 +From: akallabeth +Date: Thu, 6 Oct 2022 09:12:40 +0200 +Subject: [PATCH] Fix length checks in parallel driver + +The length requested was not checked against the length read from +the port. + +(cherry picked from commit 094cc5a4596c299595b732effd59ee149181fd61) +--- + channels/parallel/client/parallel_main.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/channels/parallel/client/parallel_main.c b/channels/parallel/client/parallel_main.c +index af3e82703a60..993605a65e23 100644 +--- a/channels/parallel/client/parallel_main.c ++++ b/channels/parallel/client/parallel_main.c +@@ -159,7 +159,7 @@ static UINT parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp) + return ERROR_INVALID_DATA; + Stream_Read_UINT32(irp->input, Length); + Stream_Read_UINT64(irp->input, Offset); +- buffer = (BYTE*)malloc(Length); ++ buffer = (BYTE*)calloc(Length, sizeof(BYTE)); + + if (!buffer) + { +@@ -178,6 +178,7 @@ static UINT parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp) + } + else + { ++ Length = status; + } + + Stream_Write_UINT32(irp->output, Length); diff --git a/debian/patches/series b/debian/patches/series index adecd77..ba51548 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -46,3 +46,4 @@ 0055-CVE-2022-39319.patch 0056-CVE-2022-39347.patch 0057-CVE-2022-41877.patch +0058-CVE-2022-39282.patch