]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.3.10 v3.3.10
authorWietse Venema <wietse@porcupine.org>
Sat, 16 May 2020 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <postfix-users@dukhovni.org>
Mon, 18 May 2020 08:35:30 +0000 (04:35 -0400)
12 files changed:
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/makedefs
postfix/src/global/mail_params.c
postfix/src/global/mail_version.h
postfix/src/milter/milter.c
postfix/src/smtpd/smtpd_check.c
postfix/src/tls/tls_bio_ops.c
postfix/src/tls/tls_session.c
postfix/src/tlsproxy/tlsproxy.c
postfix/src/util/midna_domain.c
postfix/src/util/midna_domain.h

index bad4ed2680996cba5a98bdc019888c0c00351157..03eea986855ceb7311316e4bf735c41e53285ff0 100644 (file)
@@ -23569,3 +23569,44 @@ Apologies for any names omitted.
 
        Bitrot: LINUX5, GLIBC resolver flags. Files: makedefs,
        util/sys_defs.h, dns/dns_str_resflags.c.
+
+20200420
+
+       Noise suppression: shut up a compiler that special-cases
+       string literals. Viktor Dukhovni. File milter/milter.c.
+
+20200422
+
+       Security: disable DANE support on Alpine Linux because
+       libc-musl provides no indication whether DNS responses are
+       authentic. This broke DANE support without a clear explanation.
+       File: makedefs.
+
+20200505
+
+       Noise suppression: shut up a compiler that special-cases
+       string literals. Viktor Dukhovni. File smtpd/smtpd_check.c.
+
+20200510
+
+       Bitrot: avoid U_FILE_ACCESS_ERROR after chroot(), by
+       initializing the ICU library before making the chroot()
+       call. Files: util/midna_domain.[hc], global/mail_params.c.
+
+20200511
+
+       Noise suppression: avoid "SSL_Shutdown:shutdown while in
+       init" warnings. File: tls/tls_session.c.
+
+20200515
+
+       Bugfix (introduced: Postfix 2.2): a TLS error for a PostgreSQL
+       client caused a false 'lost connection' error for an SMTP
+       over TLS session in the same Postfix process. Reported by
+       Alexander Vasarab, diagnosed by Viktor Dukhovni. File:
+       tls/tls_bio_ops.c.
+
+       Bugfix (introduced: Postfix 2.8): a TLS error for one TLS
+       session may cause a false 'lost connection' error for a
+       concurrent TLS session in the same tlsproxy process. File:
+       tlsproxy/tlsproxy.c.
index acecd044dfbd35d9a45e9f30657ef8b6ff100241..f549d5efe738e8966d5df8fafe8a2fe057112e5c 100644 (file)
@@ -16,6 +16,14 @@ specifies the release date of a stable release or snapshot release.
 If you upgrade from Postfix 3.1 or earlier, read RELEASE_NOTES-3.2
 before proceeding.
 
+libc-musl workaround for Postfix 3.2.15, 3.3.10, 3.4.12, and 3.5.2
+------------------------------------------------------------------
+
+Security: this release disables DANE support on Linux systems with
+libc-musl, because libc-musl provides no indication whether DNS
+responses are authentic. This broke DANE support without a clear
+explanation.
+
 TLS Workaround for Postfix 3.4.6, 3.3.5, 3.2.10 and 3.1.13
 -----------------------------------------------------------
 
index a44700e2f2692a18eac2c2813eefc1a3a60caccb..eacef30b351f167698cfd13a82916a69fe2cb9c0 100644 (file)
@@ -226,6 +226,19 @@ case $# in
  *) echo usage: $0 [system release] 1>&2; exit 1;;
 esac
 
+case "$SYSTEM" in
+ Linux)
+    case "`PATH=/bin:/usr/bin ldd /bin/sh`" in
+     *-musl-*)
+       case "$CCARGS" in
+        *-DNO_DNSSEC*) ;;
+        *) echo Warning: libc-musl breaks DANE/TLSA security. 1>&2
+           echo This build will not support DANE/TLSA. 1>&2
+           CCARGS="$CCARGS -DNO_DNSSEC";;
+       esac;;
+    esac;;
+esac
+
 case "$SYSTEM.$RELEASE" in
    SCO_SV.3.2) SYSTYPE=SCO5
                # Use the native compiler by default
index 203e52feaae3314c5eb3b1b5a7435b1f75884cbb..f0b0d54093583bb9aaa1968efbe3137670b09fb7 100644 (file)
@@ -851,6 +851,8 @@ void    mail_params_init()
     var_smtputf8_enable = 0;
 #else
     midna_domain_transitional = var_idna2003_compat;
+    if (var_smtputf8_enable)
+       midna_domain_pre_chroot();
 #endif
     util_utf8_enable = var_smtputf8_enable;
 
index 7f205d67675ed17e38b6a2d9f4eedd08c6738a31..2695eea76379bab3592514c9f1455bbc21a55faf 100644 (file)
@@ -20,8 +20,8 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20200418"
-#define MAIL_VERSION_NUMBER    "3.3.9"
+#define MAIL_RELEASE_DATE      "20200516"
+#define MAIL_VERSION_NUMBER    "3.3.10"
 
 #ifdef SNAPSHOT
 #define MAIL_VERSION_DATE      "-" MAIL_RELEASE_DATE
index cee169cb47d2d18f58cdf7c2b603db6133ef491c..3d71cc6b45af195a15997e637a69f1a2b4961828 100644 (file)
@@ -620,14 +620,14 @@ void    milter_disc_event(MILTERS *milters)
   * names by skipping the redundant "milter_" prefix.
   */
 static ATTR_OVER_TIME time_table[] = {
-    7 + VAR_MILT_CONN_TIME, DEF_MILT_CONN_TIME, 0, 1, 0,
-    7 + VAR_MILT_CMD_TIME, DEF_MILT_CMD_TIME, 0, 1, 0,
-    7 + VAR_MILT_MSG_TIME, DEF_MILT_MSG_TIME, 0, 1, 0,
+    7 + (const char *) VAR_MILT_CONN_TIME, DEF_MILT_CONN_TIME, 0, 1, 0,
+    7 + (const char *) VAR_MILT_CMD_TIME, DEF_MILT_CMD_TIME, 0, 1, 0,
+    7 + (const char *) VAR_MILT_MSG_TIME, DEF_MILT_MSG_TIME, 0, 1, 0,
     0,
 };
 static ATTR_OVER_STR str_table[] = {
-    7 + VAR_MILT_PROTOCOL, 0, 1, 0,
-    7 + VAR_MILT_DEF_ACTION, 0, 1, 0,
+    7 + (const char *) VAR_MILT_PROTOCOL, 0, 1, 0,
+    7 + (const char *) VAR_MILT_DEF_ACTION, 0, 1, 0,
     0,
 };
 
index 5c2690320a499e5844008dc77b42ec481979c782..73ee5b48fc9b2e9bf1d6e1ee37e44ca9708df35f 100644 (file)
@@ -483,20 +483,20 @@ typedef struct {
   * parameter names by skipping the redundant "smtpd_policy_service_" prefix.
   */
 static ATTR_OVER_TIME time_table[] = {
-    21 + VAR_SMTPD_POLICY_TMOUT, DEF_SMTPD_POLICY_TMOUT, 0, 1, 0,
-    21 + VAR_SMTPD_POLICY_IDLE, DEF_SMTPD_POLICY_IDLE, 0, 1, 0,
-    21 + VAR_SMTPD_POLICY_TTL, DEF_SMTPD_POLICY_TTL, 0, 1, 0,
-    21 + VAR_SMTPD_POLICY_TRY_DELAY, DEF_SMTPD_POLICY_TRY_DELAY, 0, 1, 0,
+    21 + (const char *) VAR_SMTPD_POLICY_TMOUT, DEF_SMTPD_POLICY_TMOUT, 0, 1, 0,
+    21 + (const char *) VAR_SMTPD_POLICY_IDLE, DEF_SMTPD_POLICY_IDLE, 0, 1, 0,
+    21 + (const char *) VAR_SMTPD_POLICY_TTL, DEF_SMTPD_POLICY_TTL, 0, 1, 0,
+    21 + (const char *) VAR_SMTPD_POLICY_TRY_DELAY, DEF_SMTPD_POLICY_TRY_DELAY, 0, 1, 0,
     0,
 };
 static ATTR_OVER_INT int_table[] = {
-    21 + VAR_SMTPD_POLICY_REQ_LIMIT, 0, 0, 0,
-    21 + VAR_SMTPD_POLICY_TRY_LIMIT, 0, 1, 0,
+    21 + (const char *) VAR_SMTPD_POLICY_REQ_LIMIT, 0, 0, 0,
+    21 + (const char *) VAR_SMTPD_POLICY_TRY_LIMIT, 0, 1, 0,
     0,
 };
 static ATTR_OVER_STR str_table[] = {
-    21 + VAR_SMTPD_POLICY_DEF_ACTION, 0, 1, 0,
-    21 + VAR_SMTPD_POLICY_CONTEXT, 0, 1, 0,
+    21 + (const char *) VAR_SMTPD_POLICY_DEF_ACTION, 0, 1, 0,
+    21 + (const char *) VAR_SMTPD_POLICY_CONTEXT, 0, 1, 0,
     0,
 };
 
index 1f4ec41f17ea1e704428f5d6a777b991fc04a3b4..9b661954721563bfa2e252359f6cbfe06ad828fa 100644 (file)
@@ -194,6 +194,13 @@ int     tls_bio(int fd, int timeout, TLS_SESS_STATE *TLScontext,
      * handling any pending network I/O.
      */
     for (;;) {
+
+       /*
+        * Flush the per-thread SSL error queue. Otherwise, errors from other
+        * code that also uses TLS may confuse SSL_get_error(3).
+        */
+       ERR_clear_error();
+
        if (hsfunc)
            status = hsfunc(TLScontext->con);
        else if (rfunc)
index 8a95e903bbfb2341d6170f9d8d7659d12fed0998..c618848e0ac7448694b5e8aac2f06fe2e0a28074 100644 (file)
@@ -113,7 +113,7 @@ void    tls_session_stop(TLS_APPL_STATE *unused_ctx, VSTREAM *stream, int timeou
      * so we will not perform SSL_shutdown() and the session will be removed
      * as being bad.
      */
-    if (!failure) {
+    if (!failure && !SSL_in_init(TLScontext->con)) {
        retval = tls_bio_shutdown(vstream_fileno(stream), timeout, TLScontext);
        if (!var_tls_fast_shutdown && retval == 0)
            tls_bio_shutdown(vstream_fileno(stream), timeout, TLScontext);
index dc1550640eb56b9724dd981b4f2380ec0147d3bc..f025b32ef1b02f7683a9064c71b9d446ab26c14b 100644 (file)
@@ -476,6 +476,7 @@ static void tlsp_strategy(TLSP_STATE *state)
      * pending read/write and timeout event requests.
      */
     if (state->flags & TLSP_FLAG_DO_HANDSHAKE) {
+       ERR_clear_error();
        ssl_stat = SSL_accept(tls_context->con);
        if (ssl_stat != 1) {
            handshake_err = SSL_get_error(tls_context->con, ssl_stat);
@@ -510,6 +511,7 @@ static void tlsp_strategy(TLSP_STATE *state)
     if (NBBIO_ERROR_FLAGS(plaintext_buf)) {
        if (NBBIO_ACTIVE_FLAGS(plaintext_buf))
            nbbio_disable_readwrite(state->plaintext_buf);
+       ERR_clear_error();
        if (!SSL_in_init(tls_context->con)
            && (ssl_stat = SSL_shutdown(tls_context->con)) < 0) {
            handshake_err = SSL_get_error(tls_context->con, ssl_stat);
@@ -536,6 +538,7 @@ static void tlsp_strategy(TLSP_STATE *state)
      */
     ssl_write_err = SSL_ERROR_NONE;
     while (NBBIO_READ_PEND(plaintext_buf) > 0) {
+       ERR_clear_error();
        ssl_stat = SSL_write(tls_context->con, NBBIO_READ_BUF(plaintext_buf),
                             NBBIO_READ_PEND(plaintext_buf));
        ssl_write_err = SSL_get_error(tls_context->con, ssl_stat);
@@ -566,6 +569,7 @@ static void tlsp_strategy(TLSP_STATE *state)
      */
     ssl_read_err = SSL_ERROR_NONE;
     while (NBBIO_WRITE_PEND(state->plaintext_buf) < NBBIO_BUFSIZE(plaintext_buf)) {
+       ERR_clear_error();
        ssl_stat = SSL_read(tls_context->con,
                            NBBIO_WRITE_BUF(plaintext_buf)
                            + NBBIO_WRITE_PEND(state->plaintext_buf),
index 667e75e59f0c5415a9903faae5631e222ac18647..333a5c91d74819c10297ca7907e29bd556e881dc 100644 (file)
@@ -20,6 +20,8 @@
 /*
 /*     const char *midna_domain_suffix_to_utf8(
 /*     const char *name)
+/* AUXILIARY FUNCTIONS
+/*     void midna_domain_pre_chroot(void)
 /* DESCRIPTION
 /*     The functions in this module transform domain names from/to
 /*     ASCII and UTF-8 form. The result is cached to avoid repeated
@@ -52,6 +54,8 @@
 /*
 /*     midna_domain_transitional enables transitional conversion
 /*     between UTF8 and ASCII labels.
+/*
+/*     midna_domain_pre_chroot() does some pre-chroot initialization.
 /* SEE ALSO
 /*     http://unicode.org/reports/tr46/ Unicode IDNA Compatibility processing
 /*     msg(3) diagnostics interface
@@ -144,6 +148,22 @@ static const char *midna_domain_strerror(UErrorCode error, int info_errors)
     }
 }
 
+/* midna_domain_pre_chroot - pre-chroot initialization */
+
+void    midna_domain_pre_chroot(void)
+{
+    UErrorCode error = U_ZERO_ERROR;
+    UIDNAInfo info = UIDNA_INFO_INITIALIZER;
+    UIDNA  *idna;
+
+    idna = uidna_openUTS46(midna_domain_transitional ? UIDNA_DEFAULT
+                          : UIDNA_NONTRANSITIONAL_TO_ASCII, &error);
+    if (U_FAILURE(error))
+       msg_warn("ICU library initialization failed: %s",
+                midna_domain_strerror(error, info.errors));
+    uidna_close(idna);
+}
+
 /* midna_domain_to_ascii_create - convert domain to ASCII */
 
 static void *midna_domain_to_ascii_create(const char *name, void *unused_context)
@@ -327,6 +347,7 @@ const char *midna_domain_suffix_to_utf8(const char *name)
  /*
   * Test program - reads names from stdin, reports invalid names to stderr.
   */
+#include <unistd.h>
 #include <stdlib.h>
 #include <locale.h>
 
@@ -350,6 +371,11 @@ int     main(int argc, char **argv)
     /* msg_verbose = 1; */
     util_utf8_enable = 1;
 
+    if (geteuid() == 0) {
+       midna_domain_pre_chroot();
+       if (chroot(".") != 0)
+           msg_fatal("chroot(\".\"): %m");
+    }
     while (vstring_fgets_nonl(buffer, VSTREAM_IN)) {
        bp = STR(buffer);
        msg_info("> %s", bp);
index 03d875b106c4a0b4a944118e50652dfa09a36536..1abe2a173b7e70b064df67756c6368ddebe4c371 100644 (file)
@@ -18,6 +18,7 @@ extern const char *midna_domain_to_ascii(const char *);
 extern const char *midna_domain_to_utf8(const char *);
 extern const char *midna_domain_suffix_to_ascii(const char *);
 extern const char *midna_domain_suffix_to_utf8(const char *);
+extern void midna_domain_pre_chroot(void);
 
 extern int midna_domain_cache_size;
 extern int midna_domain_transitional;