From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Nov 28 16:50:02 2008 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 71E711065677 for ; Fri, 28 Nov 2008 16:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 55ABC8FC1B for ; Fri, 28 Nov 2008 16:50:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id mASGo2Do055238 for ; Fri, 28 Nov 2008 16:50:02 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id mASGo22P055237; Fri, 28 Nov 2008 16:50:02 GMT (envelope-from gnats) Resent-Date: Fri, 28 Nov 2008 16:50:02 GMT Resent-Message-Id: <200811281650.mASGo22P055237@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Maxim Dounin Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A36231065672 for ; Fri, 28 Nov 2008 16:47:46 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: from mdounin.cust.ramtel.ru (mdounin.cust.ramtel.ru [81.19.69.81]) by mx1.freebsd.org (Postfix) with ESMTP id 640F18FC22 for ; Fri, 28 Nov 2008 16:47:46 +0000 (UTC) (envelope-from mdounin@mdounin.ru) Received: by mdounin.cust.ramtel.ru (Postfix, from userid 1000) id 757E01702A; Fri, 28 Nov 2008 19:32:35 +0300 (MSK) Message-Id: <20081128163235.757E01702A@mdounin.cust.ramtel.ru> Date: Fri, 28 Nov 2008 19:32:35 +0300 (MSK) From: Maxim Dounin To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: ports/129260: [patch] mail/exim - reinitialize len before calling accept() X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Maxim Dounin List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2008 16:50:02 -0000 >Number: 129260 >Category: ports >Synopsis: [patch] mail/exim - reinitialize len before calling accept() >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Nov 28 16:50:01 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Maxim Dounin >Release: FreeBSD 7.0-RELEASE-p3 i386 >Organization: >Environment: System: FreeBSD mdounin.cust.ramtel.ru 7.0-RELEASE-p3 FreeBSD 7.0-RELEASE-p3 #2: Tue Jul 22 13:51:10 MSD 2008 root@mdounin.cust.ramtel.ru:/usr/obj/usr/src/sys/GENERIC i386 >Description: In exim accept loop reinitialization of len argument of accept() missing between calls when working with multiple listening sockets (as of exim 4.69). As a result some connections may be treated by exim as connections from unrelated ip addresses. More information in exim's bugzilla: http://bugs.exim.org/show_bug.cgi?id=770 >How-To-Repeat: >Fix: The following patch fixes the problem. I've submitted this fix to upstream, but probably adding this patch to FreeBSD ports tree is a good idea. --- patch-exim-accept.txt begins here --- --- src/daemon.c.orig Sat Aug 30 03:49:46 2008 +++ src/daemon.c Mon Sep 1 00:46:09 2008 @@ -1613,7 +1613,7 @@ struct sockaddr_in accepted; #endif - EXIM_SOCKLEN_T len = sizeof(accepted); + EXIM_SOCKLEN_T len; pid_t pid; /* This code is placed first in the loop, so that it gets obeyed at the @@ -1808,6 +1808,7 @@ { if (FD_ISSET(listen_sockets[sk], &select_listen)) { + len = sizeof(accepted); accept_socket = accept(listen_sockets[sk], (struct sockaddr *)&accepted, &len); FD_CLR(listen_sockets[sk], &select_listen); --- patch-exim-accept.txt ends here --- >Release-Note: >Audit-Trail: >Unformatted: