diff options
author | Ariadne Conill <ariadne@dereferenced.org> | 2021-04-30 09:25:14 -0600 |
---|---|---|
committer | Ariadne Conill <ariadne@dereferenced.org> | 2021-04-30 09:25:14 -0600 |
commit | fcabe3349a5cc19c4cb99c8424e4c0b4b3c509e3 (patch) | |
tree | 80a7d5b6da11630e1f51838a0791bc26a6addd79 | |
parent | 4d42ecbb26ad0ca5d9f68ffc2e03d084d419c035 (diff) | |
download | aports-fcabe3349a5cc19c4cb99c8424e4c0b4b3c509e3.tar.gz aports-fcabe3349a5cc19c4cb99c8424e4c0b4b3c509e3.tar.bz2 aports-fcabe3349a5cc19c4cb99c8424e4c0b4b3c509e3.tar.xz |
main/opensmtpd: add the missing patches
-rw-r--r-- | main/opensmtpd/CVE-2020-35679.patch | 35 | ||||
-rw-r--r-- | main/opensmtpd/CVE-2020-35680.patch | 26 |
2 files changed, 61 insertions, 0 deletions
diff --git a/main/opensmtpd/CVE-2020-35679.patch b/main/opensmtpd/CVE-2020-35679.patch new file mode 100644 index 00000000000..6746c274477 --- /dev/null +++ b/main/opensmtpd/CVE-2020-35679.patch @@ -0,0 +1,35 @@ +From 79a034b4aed29e965f45a13409268290c9910043 Mon Sep 17 00:00:00 2001 +From: martijn <martijn@openbsd.org> +Date: Wed, 23 Dec 2020 08:12:14 +0000 +Subject: [PATCH] Use regfree after we're done with preg. + +From gilles@ +--- + smtpd/table.c | 9 +++++++-- + 1 file changed, 7 insertions(+), 2 deletions(-) + +diff --git a/usr.sbin/smtpd/table.c b/usr.sbin/smtpd/table.c +index b79451caadd4..1d82d88b81a4 100644 +--- a/smtpd/table.c ++++ b/smtpd/table.c +@@ -464,6 +464,7 @@ table_regex_match(const char *string, const char *pattern) + { + regex_t preg; + int cflags = REG_EXTENDED|REG_NOSUB; ++ int ret; + + if (strncmp(pattern, "(?i)", 4) == 0) { + cflags |= REG_ICASE; +@@ -473,7 +474,11 @@ table_regex_match(const char *string, const char *pattern) + if (regcomp(&preg, pattern, cflags) != 0) + return (0); + +- if (regexec(&preg, string, 0, NULL, 0) != 0) ++ ret = regexec(&preg, string, 0, NULL, 0); ++ ++ regfree(&preg); ++ ++ if (ret != 0) + return (0); + + return (1); diff --git a/main/opensmtpd/CVE-2020-35680.patch b/main/opensmtpd/CVE-2020-35680.patch new file mode 100644 index 00000000000..4496abe3b8c --- /dev/null +++ b/main/opensmtpd/CVE-2020-35680.patch @@ -0,0 +1,26 @@ +From 6c3220444ed06b5796dedfd53a0f4becd903c0d1 Mon Sep 17 00:00:00 2001 +From: millert <millert@openbsd.org> +Date: Wed, 23 Dec 2020 20:17:49 +0000 +Subject: [PATCH] smtpd's filter state machine can prematurely release + resources leading to a crash. From gilles@ + +--- + smtpd/lka_filter.c | 7 +------ + 1 file changed, 1 insertion(+), 6 deletions(-) + +diff --git a/usr.sbin/smtpd/lka_filter.c b/usr.sbin/smtpd/lka_filter.c +index 21b10ce1033b..d1194254d8df 100644 +--- a/smtpd/lka_filter.c ++++ b/smtpd/lka_filter.c +@@ -600,11 +600,6 @@ filter_session_io(struct io *io, int evt, void *arg) + filter_data(fs->id, line); + + goto nextline; +- +- case IO_DISCONNECTED: +- io_free(fs->io); +- fs->io = NULL; +- break; + } + } + |