Re: lmtp crashing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/09/10 10:43, Michael Plate wrote:

MP> after upgrading some parts of our server (Gentoo Linux), cyrus 2.3.14 is
MP> crashing with lmtp deliver *only* on Shared Folders.

Is it a 32-bit system? If so, you may be hitting a known problem caused by a parameter size disagreement wrt quota_t (which is a long long, ie 64 bits) vs long (which is only 32 bits on Linux/x86). The compiler doesn't catch this since verify_user() is called via a function pointer.

The attached patch should fix it, or you can of course upgrade to a more recent version.

MP> I tried to attach the debugger, but missing some knowledge how to
MP> continue (I'am able using a debugger, but what to do when attached ?).

Probably not very useful unless you've switched the lmtpd binary for an unstripped (and preferably non-optimised) one. The symptom of the above bug is parameters getting trashed as the come off the stack when process_recipient() calls verify_user().


Cheers


Duncan

--
Duncan Gibb
Debian Cyrus Team - https://alioth.debian.org/projects/pkg-cyrus-imapd/

#! /bin/sh /usr/share/dpatch/dpatch-run
## 0026-upstream-fix-verify_user-paramtypes.dpatch by Duncan Gibb <duncan.gibb@xxxxxxxxxxxxxx>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Upstream: fix parameter-typing bug which can break IGNOREQUOTA
## DP: and lead to lmtpd segfaulting on 32-bit systems.
## DP: This is almost verbatim
## DP: https://bugzilla.andrew.cmu.edu/cgi-bin/cvsweb.cgi/src/cyrus/imap/lmtpengine.c.diff?r1=1.130;r2=1.131

@DPATCH@
--- cyrus/imap/lmtpengine.c	2009/03/31 04:11:18	1.130
+++ cyrus/imap/lmtpengine.c	2009/04/23 01:30:32	1.131
@@ -39,7 +39,7 @@
  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  *
- * $Id: lmtpengine.c,v 1.129 2008/10/08 15:47:08 murch Exp $
+ * $Id: lmtpengine.c,v 1.131 2009/04/23 01:30:32 murch Exp $
  */
 
 #include <config.h>
@@ -809,7 +809,7 @@ static int savemsg(struct clientdata *cd
 static int process_recipient(char *addr, struct namespace *namespace,
 			     int ignorequota,
 			     int (*verify_user)(const char *, const char *,
-						char *, long,
+						char *, quota_t,
 						struct auth_state *),
 			     message_data_t *msg)
 {
@@ -898,7 +898,7 @@ static int process_recipient(char *addr,
 	ret->user = NULL;
 
     r = verify_user(ret->user, ret->domain, ret->mailbox,
-		    ignorequota ? -1 : msg->size, msg->authstate);
+		    (quota_t) (ignorequota ? -1 : msg->size), msg->authstate);
     if (r) {
 	/* we lost */
 	free(ret->all);
----
Cyrus Home Page: http://www.cyrusimap.org/
List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux