Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Nov 2008 19:32:35 +0300 (MSK)
From:      Maxim Dounin <mdounin@mdounin.ru>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/129260: [patch] mail/exim - reinitialize len before calling accept()
Message-ID:  <20081128163235.757E01702A@mdounin.cust.ramtel.ru>
Resent-Message-ID: <200811281650.mASGo22P055237@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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:



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