Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 May 2018 07:17:33 +0000 (UTC)
From:      Dima Panov <fluffy@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r469267 - in branches/2018Q2/mail: opensmtpd opensmtpd-devel opensmtpd-devel/files opensmtpd/files
Message-ID:  <201805070717.w477HXIG066685@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: fluffy
Date: Mon May  7 07:17:33 2018
New Revision: 469267
URL: https://svnweb.freebsd.org/changeset/ports/469267

Log:
  MFH: r468996
  
  - 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)
  
  Approved by:	ports-secteam (riggs)

Added:
  branches/2018Q2/mail/opensmtpd-devel/files/patch-smtpd-rfc2822.c
     - copied unchanged from r468996, head/mail/opensmtpd-devel/files/patch-smtpd-rfc2822.c
  branches/2018Q2/mail/opensmtpd-devel/files/patch-smtpd-smtp_session.c
     - copied unchanged from r468996, head/mail/opensmtpd-devel/files/patch-smtpd-smtp_session.c
  branches/2018Q2/mail/opensmtpd/files/patch-smtpd-rfc2822.c
     - copied unchanged from r468996, head/mail/opensmtpd/files/patch-smtpd-rfc2822.c
  branches/2018Q2/mail/opensmtpd/files/patch-smtpd-smtp_session.c
     - copied unchanged from r468996, head/mail/opensmtpd/files/patch-smtpd-smtp_session.c
Modified:
  branches/2018Q2/mail/opensmtpd-devel/Makefile
  branches/2018Q2/mail/opensmtpd/Makefile
Directory Properties:
  branches/2018Q2/   (props changed)

Modified: branches/2018Q2/mail/opensmtpd-devel/Makefile
==============================================================================
--- branches/2018Q2/mail/opensmtpd-devel/Makefile	Mon May  7 05:34:43 2018	(r469266)
+++ branches/2018Q2/mail/opensmtpd-devel/Makefile	Mon May  7 07:17:33 2018	(r469267)
@@ -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/ \

Copied: branches/2018Q2/mail/opensmtpd-devel/files/patch-smtpd-rfc2822.c (from r468996, head/mail/opensmtpd-devel/files/patch-smtpd-rfc2822.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2018Q2/mail/opensmtpd-devel/files/patch-smtpd-rfc2822.c	Mon May  7 07:17:33 2018	(r469267, copy of r468996, head/mail/opensmtpd-devel/files/patch-smtpd-rfc2822.c)
@@ -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

Copied: branches/2018Q2/mail/opensmtpd-devel/files/patch-smtpd-smtp_session.c (from r468996, head/mail/opensmtpd-devel/files/patch-smtpd-smtp_session.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2018Q2/mail/opensmtpd-devel/files/patch-smtpd-smtp_session.c	Mon May  7 07:17:33 2018	(r469267, copy of r468996, head/mail/opensmtpd-devel/files/patch-smtpd-smtp_session.c)
@@ -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: branches/2018Q2/mail/opensmtpd/Makefile
==============================================================================
--- branches/2018Q2/mail/opensmtpd/Makefile	Mon May  7 05:34:43 2018	(r469266)
+++ branches/2018Q2/mail/opensmtpd/Makefile	Mon May  7 07:17:33 2018	(r469267)
@@ -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/

Copied: branches/2018Q2/mail/opensmtpd/files/patch-smtpd-rfc2822.c (from r468996, head/mail/opensmtpd/files/patch-smtpd-rfc2822.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2018Q2/mail/opensmtpd/files/patch-smtpd-rfc2822.c	Mon May  7 07:17:33 2018	(r469267, copy of r468996, head/mail/opensmtpd/files/patch-smtpd-rfc2822.c)
@@ -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

Copied: branches/2018Q2/mail/opensmtpd/files/patch-smtpd-smtp_session.c (from r468996, head/mail/opensmtpd/files/patch-smtpd-smtp_session.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2018Q2/mail/opensmtpd/files/patch-smtpd-smtp_session.c	Mon May  7 07:17:33 2018	(r469267, copy of r468996, head/mail/opensmtpd/files/patch-smtpd-smtp_session.c)
@@ -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;
+ 		}
+ 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805070717.w477HXIG066685>