kumquat-buildroot/package/exim/0009-Fix-non-WITH_CONTENT_SCAN-build-3.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

50 lines
1.6 KiB
Diff

From 32da6327e434e986a18b75a84f2d8c687ba14619 Mon Sep 17 00:00:00 2001
From: Jeremy Harris <jgh146exb@wizmail.org>
Date: Thu, 1 Sep 2022 15:54:35 +0100
Subject: [PATCH] Fix non-WITH_CONTENT_SCAN build (3)
Broken-by: d8ecc7bf97
[Upstream: https://sources.debian.org/data/main/e/exim4/4.96-9/debian/patches/75_11-Fix-non-WITH_CONTENT_SCAN-build-3.patch]
[Peter: drop Changelog hunk]
Signed-off-by: Peter Korsgaard <peter@korsgard.com>
---
src/expand.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/expand.c b/src/expand.c
index 89de56255..831ca2b75 100644
--- a/src/expand.c
+++ b/src/expand.c
@@ -1869,6 +1869,7 @@ if (Ustrncmp(name, "auth", 4) == 0)
if (!*endptr && n != 0 && n <= AUTH_VARS)
return auth_vars[n-1] ? auth_vars[n-1] : US"";
}
+#ifdef WITH_CONTENT_SCAN
else if (Ustrncmp(name, "regex", 5) == 0)
{
uschar *endptr;
@@ -1876,6 +1877,7 @@ else if (Ustrncmp(name, "regex", 5) == 0)
if (!*endptr && n != 0 && n <= REGEX_VARS)
return regex_vars[n-1] ? regex_vars[n-1] : US"";
}
+#endif
/* For all other variables, search the table */
@@ -8715,9 +8717,11 @@ assert_variable_notin() treats as const, so deconst is safe. */
for (int i = 0; i < AUTH_VARS; i++) if (auth_vars[i])
assert_variable_notin(US"auth<n>", US auth_vars[i], &e);
+#ifdef WITH_CONTENT_SCAN
/* check regex<n> variables. assert_variable_notin() treats as const. */
for (int i = 0; i < REGEX_VARS; i++) if (regex_vars[i])
assert_variable_notin(US"regex<n>", US regex_vars[i], &e);
+#endif
/* check known-name variables */
for (var_entry * v = var_table; v < var_table + var_table_size; v++)
--
2.35.1