diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-10-19 13:58:24 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-10-19 13:58:24 +0100 |
commit | 12652841746da7ae2f03b8b0c571a9bd5033e15c (patch) | |
tree | 17ba3a2b3f142284453d0e9109be1765200f643b /mail-mta/exim/files | |
parent | 27f7ac2204449d9fc2137f442522b4fb10327d90 (diff) |
gentoo auto-resync : 19:10:2022 - 13:58:24
Diffstat (limited to 'mail-mta/exim/files')
-rw-r--r-- | mail-mta/exim/files/exim-4.94-CVE-2022-3559.patch | 97 | ||||
-rw-r--r-- | mail-mta/exim/files/exim-4.96-dmarc_use_after_free.patch | 31 |
2 files changed, 128 insertions, 0 deletions
diff --git a/mail-mta/exim/files/exim-4.94-CVE-2022-3559.patch b/mail-mta/exim/files/exim-4.94-CVE-2022-3559.patch new file mode 100644 index 000000000000..8793514b8fb7 --- /dev/null +++ b/mail-mta/exim/files/exim-4.94-CVE-2022-3559.patch @@ -0,0 +1,97 @@ +Patch cleaned up for Gentoo +- applied to 4.94 +- removed unnecessary whitespace changes + +From 4e9ed49f8f12eb331b29bd5b6dc3693c520fddc2 Mon Sep 17 00:00:00 2001 +From: Jeremy Harris <jgh146exb@wizmail.org> +Date: Wed, 31 Aug 2022 15:37:40 +0100 +Subject: [PATCH 1/1] Fix $regex<n> use-after-free. Bug 2915 + +--- exim-4.94.2/src/exim.c 2021-04-30 14:08:21.000000000 +0200 ++++ exim-4.94.2/src/exim.c 2022-10-19 09:15:58.611447982 +0200 +@@ -1886,8 +1886,6 @@ + regex_must_compile(US"^[A-Za-z0-9_/.-]*$", FALSE, TRUE); + #endif + +-for (i = 0; i < REGEX_VARS; i++) regex_vars[i] = NULL; +- + /* If the program is called as "mailq" treat it as equivalent to "exim -bp"; + this seems to be a generally accepted convention, since one finds symbolic + links called "mailq" in standard OS configurations. */ +@@ -5841,7 +5839,7 @@ + deliver_localpart_data = deliver_domain_data = + recipient_data = sender_data = NULL; + acl_var_m = NULL; +- for(int i = 0; i < REGEX_VARS; i++) regex_vars[i] = NULL; ++ regex_vars_clear(); + + store_reset(reset_point); + } +--- exim-4.94.2/src/functions.h 2021-04-30 14:08:21.000000000 +0200 ++++ exim-4.94.2/src/functions.h 2022-10-19 09:17:44.882122667 +0200 +@@ -417,6 +417,7 @@ + #endif + extern BOOL regex_match_and_setup(const pcre *, const uschar *, int, int); + extern const pcre *regex_must_compile(const uschar *, BOOL, BOOL); ++extern void regex_vars_clear(void); + extern void retry_add_item(address_item *, uschar *, int); + extern BOOL retry_check_address(const uschar *, host_item *, uschar *, BOOL, + uschar **, uschar **); +--- exim-4.94.2/src/globals.c 2022-10-19 09:14:19.344751853 +0200 ++++ exim-4.94.2/src/globals.c 2022-10-19 09:18:27.675991666 +0200 +@@ -1289,7 +1289,7 @@ + #endif + const pcre *regex_ismsgid = NULL; + const pcre *regex_smtp_code = NULL; +-uschar *regex_vars[REGEX_VARS]; ++uschar *regex_vars[REGEX_VARS] = { 0 }; + #ifdef WHITELIST_D_MACROS + const pcre *regex_whitelisted_macro = NULL; + #endif +--- exim-4.94.2/src/regex.c 2021-04-30 14:08:21.000000000 +0200 ++++ exim-4.94.2/src/regex.c 2022-10-19 09:35:03.229084750 +0200 +@@ -98,7 +106,7 @@ + int ret = FAIL; + + /* reset expansion variable */ +-regex_match_string = NULL; ++regex_vars_clear(); + + if (!mime_stream) /* We are in the DATA ACL */ + { +@@ -166,8 +174,7 @@ + int mime_subject_len = 0; + int ret; + +-/* reset expansion variable */ +-regex_match_string = NULL; ++regex_vars_clear(); + + /* precompile our regexes */ + if (!(re_list_head = compile(*listptr))) +@@ -213,3 +205,12 @@ + } + + #endif /* WITH_CONTENT_SCAN */ ++ ++/* reset expansion variables */ ++void ++regex_vars_clear(void) ++{ ++regex_match_string = NULL; ++for (int i = 0; i < REGEX_VARS; i++) regex_vars[i] = NULL; ++} ++ +--- exim-4.94.2/src/smtp_in.c 2021-04-30 14:08:21.000000000 +0200 ++++ exim-4.94.2/src/smtp_in.c 2022-10-19 09:15:58.613447975 +0200 +@@ -2161,8 +2161,10 @@ + #ifdef SUPPORT_I18N + message_smtputf8 = FALSE; + #endif ++regex_vars_clear(); + body_linecount = body_zerocount = 0; + ++lookup_value = NULL; /* Can be set by ACL */ + sender_rate = sender_rate_limit = sender_rate_period = NULL; + ratelimiters_mail = NULL; /* Updated by ratelimit ACL condition */ + /* Note that ratelimiters_conn persists across resets. */ diff --git a/mail-mta/exim/files/exim-4.96-dmarc_use_after_free.patch b/mail-mta/exim/files/exim-4.96-dmarc_use_after_free.patch new file mode 100644 index 000000000000..dc2f62e9ba0f --- /dev/null +++ b/mail-mta/exim/files/exim-4.96-dmarc_use_after_free.patch @@ -0,0 +1,31 @@ +From 12fb3842f81bcbd4a4519d5728f2d7e0e3ca1445 Mon Sep 17 00:00:00 2001 +From: Lorenz Brun <lorenz@brun.one> +Date: Fri, 14 Oct 2022 21:02:51 +0200 +Subject: [PATCH] DMARC: fix use-after-free in dmarc_dns_lookup + +This fixes a use-after-free in dmarc_dns_lookup where the result +of dns_lookup in dnsa is freed before the required data is copied out. + +Fixes: 9258363 ("DNS: explicit alloc/free of workspace") +--- + src/src/dmarc.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/src/dmarc.c b/src/src/dmarc.c +index ad0c26c91..53c2752ac 100644 +--- a/src/src/dmarc.c ++++ b/src/src/dmarc.c +@@ -230,8 +230,9 @@ if (rc == DNS_SUCCEED) + rr = dns_next_rr(dnsa, &dnss, RESET_NEXT)) + if (rr->type == T_TXT && rr->size > 3) + { ++ uschar *record = string_copyn_taint(US rr->data, rr->size, GET_TAINTED); + store_free_dns_answer(dnsa); +- return string_copyn_taint(US rr->data, rr->size, GET_TAINTED); ++ return record; + } + store_free_dns_answer(dnsa); + return NULL; +-- +2.30.2 + |