kumquat-buildroot/package/exim/0007-Fix-non-WITH_CONTENT_SCAN-build.patch
Peter Korsgaard 4bccc70e07 package/exim: add upstream security fixes for CVE-2022-3559
Fixes CVE-2022-3559: A vulnerability was found in Exim and classified as
problematic.  This issue affects some unknown processing of the component
Regex Handler.  The manipulation leads to use after free.  The name of the
patch is 4e9ed49f8f12eb331b29bd5b6dc3693c520fddc2.  It is recommended to
apply a patch to fix this issue.  The identifier VDB-211073 was assigned to
this vulnerability.

The upstream patch does not apply to 4.96, so use the backported patches
from Debian.  Amazingly, the patch needs 3 additional patches to unbreak
builds without "WITH_CONTENT_SCAN" (default in Buildroot), so add those as
well.

Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
2022-12-03 15:31:10 +01:00

62 lines
1.4 KiB
Diff

From d8ecc7bf97934a1e2244788c610c958cacd740bd Mon Sep 17 00:00:00 2001
From: Jeremy Harris <jgh146exb@wizmail.org>
Date: Wed, 31 Aug 2022 17:03:37 +0100
Subject: [PATCH] Fix non-WITH_CONTENT_SCAN build.
Broken-by: 4e9ed49f8f
[Upstream: https://sources.debian.org/data/main/e/exim4/4.96-9/debian/patches/75_09-Fix-non-WITH_CONTENT_SCAN-build.patch]
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
src/exim.c | 11 +++++++++++
src/regex.c | 10 ----------
2 files changed, 11 insertions(+), 10 deletions(-)
--- a/src/exim.c
+++ b/src/exim.c
@@ -1677,10 +1677,21 @@
if ((s = expand_string(big_buffer))) printf("%s\n", CS s);
else printf("Failed: %s\n", expand_string_message);
}
+/* reset regex expansion variables */
+void
+regex_vars_clear(void)
+{
+regex_match_string = NULL;
+for (int i = 0; i < REGEX_VARS; i++) regex_vars[i] = NULL;
+}
+
+
+
+
/*************************************************
* Entry point and high-level code *
*************************************************/
--- a/src/regex.c
+++ b/src/regex.c
@@ -95,20 +95,10 @@
pcre2_match_data_free(md);
return FAIL;
}
-/* reset expansion variables */
-void
-regex_vars_clear(void)
-{
-regex_match_string = NULL;
-for (int i = 0; i < REGEX_VARS; i++) regex_vars[i] = NULL;
-}
-
-
-
int
regex(const uschar ** listptr)
{
unsigned long mbox_size;
FILE * mbox_file;