From owner-svn-ports-head@freebsd.org Thu May 3 23:17:25 2018 Return-Path: Delivered-To: svn-ports-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A916FBF841; Thu, 3 May 2018 23:17:25 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E8157FBDE; Thu, 3 May 2018 23:17:25 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4943426810; Thu, 3 May 2018 23:17:25 +0000 (UTC) (envelope-from fluffy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w43NHPI2081457; Thu, 3 May 2018 23:17:25 GMT (envelope-from fluffy@FreeBSD.org) Received: (from fluffy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w43NHODD081450; Thu, 3 May 2018 23:17:24 GMT (envelope-from fluffy@FreeBSD.org) Message-Id: <201805032317.w43NHODD081450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fluffy set sender to fluffy@FreeBSD.org using -f From: Dima Panov Date: Thu, 3 May 2018 23:17:24 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r468996 - in head/mail: opensmtpd opensmtpd-devel opensmtpd-devel/files opensmtpd/files X-SVN-Group: ports-head X-SVN-Commit-Author: fluffy X-SVN-Commit-Paths: in head/mail: opensmtpd opensmtpd-devel opensmtpd-devel/files opensmtpd/files X-SVN-Commit-Revision: 468996 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 May 2018 23:17:25 -0000 Author: fluffy Date: Thu May 3 23:17:24 2018 New Revision: 468996 URL: https://svnweb.freebsd.org/changeset/ports/468996 Log: - Prevent OpenSMTPD session hangs and retain a descriptor forever on empty body (i.e. when the dot appears on the line directly after the headers). This could be used by an attacker to exhaust resources. PR: 227899 Submitted by: grembo Obtained from: OpenSMTPD git repo (backported) MFH: 2018Q2 Added: head/mail/opensmtpd-devel/files/patch-smtpd-rfc2822.c (contents, props changed) head/mail/opensmtpd-devel/files/patch-smtpd-smtp_session.c (contents, props changed) head/mail/opensmtpd/files/patch-smtpd-rfc2822.c (contents, props changed) head/mail/opensmtpd/files/patch-smtpd-smtp_session.c (contents, props changed) Modified: head/mail/opensmtpd-devel/Makefile head/mail/opensmtpd/Makefile Modified: head/mail/opensmtpd-devel/Makefile ============================================================================== --- head/mail/opensmtpd-devel/Makefile Thu May 3 23:10:11 2018 (r468995) +++ head/mail/opensmtpd-devel/Makefile Thu May 3 23:17:24 2018 (r468996) @@ -4,7 +4,7 @@ PORTNAME= opensmtpd PORTVERSION= 201606220754 DISTVERSIONSUFFIX= p1 -PORTREVISION= 4 +PORTREVISION= 5 PORTEPOCH= 1 CATEGORIES= mail MASTER_SITES= http://www.opensmtpd.org/archives/ \ Added: head/mail/opensmtpd-devel/files/patch-smtpd-rfc2822.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/opensmtpd-devel/files/patch-smtpd-rfc2822.c Thu May 3 23:17:24 2018 (r468996) @@ -0,0 +1,19 @@ +--- smtpd/rfc2822.c.orig 2018-05-01 13:33:10.000000000 +0000 ++++ smtpd/rfc2822.c 2018-05-01 13:34:47.931554000 +0000 +@@ -53,4 +53,7 @@ + struct rfc2822_hdr_miss_cb *hdr_miss_cb; ++ ++ if (!rp->in_hdr) ++ goto end; + + TAILQ_FOREACH(hdr_cb, &rp->hdr_cb, next) + if (strcasecmp(hdr_cb->name, rp->header.name) == 0) { +@@ -151,6 +152,8 @@ + return; + + header_callback(rp); ++ ++ missing_headers_callback(rp); + } + + void Added: head/mail/opensmtpd-devel/files/patch-smtpd-smtp_session.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/opensmtpd-devel/files/patch-smtpd-smtp_session.c Thu May 3 23:17:24 2018 (r468996) @@ -0,0 +1,11 @@ +--- smtpd/smtp_session.c.orig 2018-05-01 13:35:00.375262000 +0000 ++++ smtpd/smtp_session.c 2018-05-01 13:37:22.637096000 +0000 +@@ -1345,6 +1345,8 @@ + s->dataeom = 1; + if (iobuf_queued(&s->obuf) == 0) + smtp_data_io_done(s); ++ else ++ io_reload(&s->oev); + return; + } + Modified: head/mail/opensmtpd/Makefile ============================================================================== --- head/mail/opensmtpd/Makefile Thu May 3 23:10:11 2018 (r468995) +++ head/mail/opensmtpd/Makefile Thu May 3 23:17:24 2018 (r468996) @@ -4,7 +4,7 @@ PORTNAME= opensmtpd PORTVERSION= 5.9.2p1 PORTEPOCH= 1 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= mail MASTER_SITES= http://www.opensmtpd.org/archives/ \ http://distfiles.pirateparty.in/ashish/ Added: head/mail/opensmtpd/files/patch-smtpd-rfc2822.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/opensmtpd/files/patch-smtpd-rfc2822.c Thu May 3 23:17:24 2018 (r468996) @@ -0,0 +1,19 @@ +--- smtpd/rfc2822.c.orig 2018-05-01 13:33:10.000000000 +0000 ++++ smtpd/rfc2822.c 2018-05-01 13:34:47.931554000 +0000 +@@ -53,4 +53,7 @@ + struct rfc2822_hdr_miss_cb *hdr_miss_cb; ++ ++ if (!rp->in_hdr) ++ goto end; + + TAILQ_FOREACH(hdr_cb, &rp->hdr_cb, next) + if (strcasecmp(hdr_cb->name, rp->header.name) == 0) { +@@ -151,6 +152,8 @@ + return; + + header_callback(rp); ++ ++ missing_headers_callback(rp); + } + + void Added: head/mail/opensmtpd/files/patch-smtpd-smtp_session.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/mail/opensmtpd/files/patch-smtpd-smtp_session.c Thu May 3 23:17:24 2018 (r468996) @@ -0,0 +1,11 @@ +--- smtpd/smtp_session.c.orig 2018-05-01 13:35:00.375262000 +0000 ++++ smtpd/smtp_session.c 2018-05-01 13:37:22.637096000 +0000 +@@ -1345,6 +1345,8 @@ + s->dataeom = 1; + if (iobuf_queued(&s->obuf) == 0) + smtp_data_io_done(s); ++ else ++ io_reload(&s->oev); + return; + } +