From nobody@FreeBSD.org  Mon Dec 18 09:55:01 2006
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id CC05016A407
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Dec 2006 09:55:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [69.147.83.33])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3702843CA8
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Dec 2006 09:55:01 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id kBI9t0kK031079
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 18 Dec 2006 09:55:00 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id kBI9t0KT031078;
	Mon, 18 Dec 2006 09:55:00 GMT
	(envelope-from nobody)
Message-Id: <200612180955.kBI9t0KT031078@www.freebsd.org>
Date: Mon, 18 Dec 2006 09:55:00 GMT
From: Peter Olsson<pol@leissner.se>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Extracted mime part of spam email makes file dump core
X-Send-Pr-Version: www-3.0

>Number:         106858
>Category:       bin
>Synopsis:       Extracted mime part of spam email makes file(1) dump core
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 18 10:00:22 GMT 2006
>Closed-Date:    Fri May 16 18:19:12 UTC 2008
>Last-Modified:  Fri May 16 18:19:12 UTC 2008
>Originator:     Peter Olsson
>Release:        6.1-RELEASE-p11
>Organization:
Leissner Data AB
>Environment:
FreeBSD antispam3.xxx.xx 6.1-RELEASE-p11 FreeBSD 6.1-RELEASE-p11 #2: Sat Dec  9 00:19:22 CET 2006     root@antispam3.xxx.xx:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
A spam email had its parts extracted via amavisd-new. The first part,
text only, made file dump core. This caused amavisd-new to repeat the
extraction process and file dumped core again and so on until the
partition was filled. The extracted file is only 937 byte, so there
must be some pattern in there that file has problems with. How do I
give you the problem file? Should I email it somewhere as an encrypted
zip file?
>How-To-Repeat:
Run file on the file.
>Fix:

>Release-Note:
>Audit-Trail:

From: "Joseph Koshy" <joseph.koshy@gmail.com>
To: "Peter Olsson" <pol@leissner.se>
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: misc/106858: Extracted mime part of spam email makes file dump core
Date: Mon, 18 Dec 2006 15:40:40 +0530

 > How do I give you the problem file? Should I email it somewhere > as an encrypted zip file?
 
 You could use uuencode(1) and send it in as an attachment to
 this PR.
Responsible-Changed-From-To: freebsd-bugs->freebsd-ports-bugs 
Responsible-Changed-By: remko 
Responsible-Changed-When: Mon Dec 18 11:03:07 UTC 2006 
Responsible-Changed-Why:  
Reassign to the ports team, this seems amavisd-new related. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106858 

From: Peter Olsson <pol@leissner.se>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: misc/106858: Extracted mime part of spam email makes file dump
 core
Date: Mon, 18 Dec 2006 11:36:19 +0100 (SNT)

   This message is in MIME format.  The first part should be readable text,
   while the remaining parts are likely unreadable without MIME-aware tools.
 
 --0-878610218-1166438179=:6686
 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
 
 UUencoded problem file attached. Run file on the extracted file to
 cause the core dump. I have tried this in 6.1-RELEASE-p11 and
 6.1-RELEASE-p10, core dump in both.
 
 However, in 4.11-RELEASE-p26, I get this result:
 $ file p001
 p001: ASCII English text
 
 -- 
 Peter Olsson                    pol@leissner.se
 --0-878610218-1166438179=:6686
 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=p001.uu
 Content-Transfer-Encoding: BASE64
 Content-ID: <20061218113619.H6686@pol.leissner.se>
 Content-Description: 
 Content-Disposition: attachment; filename=p001.uu
 
 YmVnaW4gNjQwIHAwMDENCk0iRS1LOTchVDo2LVMrIiFIO1c9RT1GNVIrIiFT
 PTctUDk2LVQoJzFIODcwQDhGUUE7NkVOOVIhJTM0OEANCk08VjVOPFZFVDo3
 OUk9J0RAOUZdUignMUg5NkVSKCZFTDsnLEA4NlVPPTZZVDxSIVQ7UiFBO0Ih
 RTg3LVkNCk0oJiVOPFc9RTxCIVQ7UiFBOyZVTzxXMEA4NllZKCZVRTkmRUM4
 NlBAPCcpTzhGUUU7MlgqKERVTzxXMEANCk07VjhAOzdEQD1WXVI6UiFUOiY1
 UzkyIUQ4N0VTKCYxRTxGRVY5NyxAOUcpTzsyIVQ6JkVTKCctRTtHLUUNCk0o
 Jl1GKCc9TztGMUU8QiFUOiY0QDhXNVI6Nl1TOjcxWSgmRVQoJiVSO1c1Uzk3
 LEA4NilPPTcwQD0mQUUNCk0oJy1QOTYtSTlGRUMoJi1SOTYlVDo3OUUoJyFS
 O1YtRTxXLUU8UiFCOTZBSTtGMEA9JkFFPFY0QDxGNVMNCk09NlFUPFJYKjVW
 NUw4Vl1NOTIhVDtSITc6NylFOSIhLjk3PVMrQiEzO1IhVzomNU4oJzFIOTIh
 Lj02NEANCk08JjVSPFZdTjg2UEA8JlFFODctVTxGNEA5JjVWOjYtRSgmOU88
 QiFNOTZYQDg3IVA5NiVSOTYwQDo2WEANCk07N0RAOzYlSTsmKU8+IlBAMjIh
 RT4mJU06NllFOSIhST0iIVc6NzFIKCYtQTxGNUY9NlBAODcxVDk2WVQNCk06
 Nl1OK0BJKTtCIVQ6JkVTKCcpRTlWJVI5IlBAMjIhQTsyIU07VylFKCY1TjhW
 XVU8RiVHOTYwQDhHREANCk09JkFFKCYxRTlGNU48VjVTKCZdRignMVI4NjFF
 KCYtTzs2RU45UiFPPTcwQDtWOEA8JlFBOFY1UygmUUkNCk06VjRANSRZMigm
 JU45IiEzOyYlVDkyIVQ6JiVOKCREQDg2VEA4R0RAPSZBRSgmOUE9VllJO0Y8
 QDtWWEANCk0yRkVNKCU9RThGKEA4Vl1NOjZZRygmXVU9IiFPOUIhMjk2JVM7
 VlhOKCREQDlXNUU8VyxAMjIhVztXKVINCk0+MiFBOEZdVT0iIUc6NiVOPSIh
 QztXKVA7VylBPSZFTztHLEA9JiVLOjZZRygmXVY5NyhAPSZBRSgkRU4NCk09
 JjVSO0Y1VCgmSVU8VzBAPVZBRTtCIUk7RjFJOTIhTDg2KUU7JyxAODcpRSgm
 PUU9JzFJO0Y8QD0mQUUNCk06NyhAOyY1RzxSUEA8VlxAPSZcQDxXIUU4NkxO
 IkYlUygmOU88QiFUOiY0QD1WQU87JjRAOFYlUignMUgNCk06NllHKCcxSDo3
 LEA6NyxAPFc1UDwmXVM5NjBAPSZcQDhGNEA4NilPPTcwXyJFPUUoJz1JOyZQ
 QDs2RVMNCk08UiFUOiY0QDxXRU04Rl1MOjYsQDg2WUQoJyFSODYtVDo2LUE7
 IiFJOzchTzxHMUE7Ri1FKCZdRignLVUNCk04VkBAOFc1VD0mRU45UlVFOSY9
 RSgmRVM8VzVFPFIhQTxSIUI6Nl1UOTYtSDtGXUw7Vj1ZKyIhUDtXIVUNCk07
 JiVSKCYtVTsnMVU8RjRMKCZFTj0mNVI7RiVUOjZdTjg2UEA9JylBOSY0TCgm
 JU45IiEpO0cxRTxGWUUNCkU9IiFHO1c5RTxGWUE7Ri1FK0IhJzk3MEA9JkFF
 KCZRSTtGTVMoJl1OKCUtWTxXMU0rQGBgDQpgDQplbmQNCg==
 
 --0-878610218-1166438179=:6686--

From: Peter Olsson <pol@leissner.se>
To: Gabor Kovesdan <gabor@freebsd.org>
Cc: bug-followup@freebsd.org
Subject: Re: ports/106858: Extracted mime part of spam email makes file dump
 core
Date: Mon, 18 Dec 2006 14:15:46 +0100 (SNT)

 On Mon, 18 Dec 2006 13:29 +0100, Gabor Kovesdan wrote:
 
 > I attached the author's answer. Could you check your file utility and if it's 
 > old, try with a newer one, please?
 >
 > Cheers,
 > Gabor
 
 Ok, file is at version 4.12 in 6.1-RELEASE-p11.
 I have tried with version 4.19 from ftp.astron.com,
 and that version does not dump core on the problem file.
 
 But I now have /usr/local/bin/file at 4.19 and /usr/bin/file
 at 4.12. What do I have to do to make the entire FreeBSD system
 use /usr/local/bin/file (and the associated magic files of the
 correct version) instead of /usr/bin/file? I can't move away from
 x.x-RELEASE-pxx because of upgrading policy on production servers.
 This goes beyond my usual cvsup, make buildworld/buildkernel/
 installkernel/installworld cycle. Should I put all files from
 file-4.19.tar into /usr/src/contrib/file and then run a make
 buildworld and make installworld?
 
 I'm sorry if this is too much of a beginners question, please
 attach some URL or some relevant search phrase to any RTFM:s.
 
 Thanks!
 
 -- 
 Peter Olsson                    pol@leissner.se

From: Gabor Kovesdan <gabor@FreeBSD.org>
To: bug-followup@FreeBSD.org,  pol@leissner.se
Cc:  
Subject: Re: ports/106858: Extracted mime part of spam email makes file dump
 core
Date: Mon, 18 Dec 2006 13:29:02 +0100

 This is a multi-part message in MIME format.
 --------------070509050303040007090604
 Content-Type: text/plain; charset=ISO-8859-15; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I attached the author's answer. Could you check your file utility and if 
 it's old, try with a newer one, please?
 
 Cheers,
 Gabor
 
 --------------070509050303040007090604
 Content-Type: message/rfc822;
  name="Re: Bug in amavisd-new?"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="Re: Bug in amavisd-new?"
 
 Return-Path: <Mark.Martinec@ijs.si>
 X-Original-To: tux@server.t-hosting.hu
 Delivered-To: tux@server.t-hosting.hu
 Received: from localhost (localhost [127.0.0.1])
 	by server.t-hosting.hu (Postfix) with ESMTP id 0591D9ABCB1
 	for <tux@server.t-hosting.hu>; Mon, 18 Dec 2006 13:04:10 +0100 (CET)
 X-Virus-Scanned: amavisd-new at t-hosting.hu
 Received: from server.t-hosting.hu ([127.0.0.1])
 	by localhost (server.t-hosting.hu [127.0.0.1]) (amavisd-new, port 10024)
 	with LMTP id H3DI7SESpu+e for <tux@server.t-hosting.hu>;
 	Mon, 18 Dec 2006 13:04:04 +0100 (CET)
 Received: from mx2.freebsd.org (mx2.freebsd.org [69.147.83.53])
 	by server.t-hosting.hu (Postfix) with ESMTP id 4CF599ABB52
 	for <gabor@kovesdan.org>; Mon, 18 Dec 2006 13:04:04 +0100 (CET)
 Received: from hub.freebsd.org (hub.freebsd.org [69.147.83.54])
 	by mx2.freebsd.org (Postfix) with ESMTP id 3384E63A23
 	for <gabor@kovesdan.org>; Mon, 18 Dec 2006 12:04:03 +0000 (GMT)
 	(envelope-from Mark.Martinec@ijs.si)
 Received: by hub.freebsd.org (Postfix)
 	id 30AB316A412; Mon, 18 Dec 2006 12:04:03 +0000 (UTC)
 Delivered-To: gabor@freebsd.org
 Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52])
 	by hub.freebsd.org (Postfix) with ESMTP id 2F7D516A403
 	for <gabor@freebsd.org>; Mon, 18 Dec 2006 12:04:03 +0000 (UTC)
 	(envelope-from Mark.Martinec@ijs.si)
 Received: from mail.ijs.si (mailman.ijs.si [193.2.4.66])
 	by mx1.FreeBSD.org (Postfix) with ESMTP id E860D43CF3
 	for <gabor@freebsd.org>; Mon, 18 Dec 2006 12:03:18 +0000 (GMT)
 	(envelope-from Mark.Martinec@ijs.si)
 Received: from localhost (mail4.ijs.si [193.2.4.66])
 	by mail.ijs.si (Postfix) with ESMTP id 1AB6A17B844
 	for <gabor@freebsd.org>; Mon, 18 Dec 2006 12:38:30 +0100 (CET)
 DKIM-Signature: a=rsa-sha1; c=relaxed/simple; d=ijs.si; s=ja-200610;
 	t=1166441910; bh=/29KcdPg8OLIYbk2hcavxSfROJk=; h=DomainKey-Signature:
 	 X-Virus-Scanned:Received:Received:Received:From:Organization:To:
 	 Subject:Date:User-Agent:References:In-Reply-To:MIME-Version:
 	 Content-Type:Content-Transfer-Encoding:Content-Disposition:
 	 Message-Id; b=sC03IU2ngIw/pbNyi+lzVRsvob04yfo1S5hr2TwJAER170I1qSYD/
 	yCoXQyyLifyyFCukXDSSjptN3a+qbJSvOLdpdltMeJL1LYys8MbNXoG5wz2QcrfY8yP
 	teT24uLv
 DomainKey-Signature: a=rsa-sha1; s=ja-200610; d=ijs.si; c=nofws; q=dns;
 	h=x-virus-scanned:received:from:organization:to:subject:date:
 	user-agent:references:in-reply-to:mime-version:content-type:
 	content-transfer-encoding:content-disposition:message-id;
 	b=KLwgg7UlSfKyp2qEEODL9RYTZFzfywnf8t2Yco6tLpfc+vvkps40M0GwkB7BVbzgt
 	BG4AyePdPUSXzs60Xlq4thA25fsw7HIeEptMIWvb3ggkk2MhdqxP4uOJu2vIela
 X-Virus-Scanned: amavisd-new at ijs.si
 Received: from mail.ijs.si ([193.2.4.66])
 	by localhost (mail.ijs.si [127.0.0.1]) (amavisd-new, port 10026)
 	with ESMTP id qxK0ACGuWmAh for <gabor@freebsd.org>;
 	Mon, 18 Dec 2006 12:38:22 +0100 (CET)
 Received: from edina.ijs.si (edina.ijs.si [193.2.4.3])
 	by mail.ijs.si (Postfix) with ESMTP id 58F9617B93A
 	for <gabor@freebsd.org>; Mon, 18 Dec 2006 12:38:22 +0100 (CET)
 Received: from sleepy.ijs.si (clj15-145.dial-up.arnes.si [212.235.133.145])
 	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
 	(No client certificate requested)
 	by edina.ijs.si (Postfix) with ESMTP id 18E2D50E06
 	for <gabor@freebsd.org>; Mon, 18 Dec 2006 12:38:22 +0100 (CET)
 From: Mark Martinec <Mark.Martinec@ijs.si>
 Organization: J. Stefan Institute
 To: Gabor Kovesdan <gabor@freebsd.org>
 Subject: Re: Bug in amavisd-new?
 Date: Mon, 18 Dec 2006 12:38:20 +0100
 User-Agent: KMail/1.9.4
 References: <45867A22.8070004@FreeBSD.org>
 In-Reply-To: <45867A22.8070004@FreeBSD.org>
 MIME-Version: 1.0
 Content-Type: text/plain;
   charset="iso-8859-15"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline
 Message-Id: <200612181238.20586.Mark.Martinec@ijs.si>
 
 > today a FreeBSD problem-report was submitted that seems to be
 > related to amavisd-new. Could you take a look, please?
 > http://www.freebsd.org/cgi/query-pr.cgi?pr=106858
 
 The necessary question is: which version of file(1) utility?
 The 4.19 is now the current version. Some of the previous
 versions were known to dump core. (which does not imply
 that 4.19 is bug-free, but is the best we have so far).
 
 > This caused amavisd-new to repeat the extraction process and
 > file dumped core again and so on until the partition was filled.  
 
 I assume this tells that mail stayed in MTA queue (tempfailed),
 and MTA repeatedly (with increasing time between attempts)
 was trying to pass mail through a content filter, which
 failed every time. This is a normal and expected behaviour
 in fatal conditions.
 
 I hope the reporter was not observing repeated calls to
 file(1) in the same amavisd session, which would be wrong.
 
   Mark
 
 --------------070509050303040007090604--

From: Mark Martinec <Mark.Martinec@ijs.si>
To: bug-followup@freebsd.org
Cc: Peter Olsson <pol@leissner.se>
Subject: Re: ports/106858: Extracted mime part of spam email makes file dump core
Date: Mon, 18 Dec 2006 14:40:07 +0100

 I tried the sample on a couple of platforms:
 
 /usr/bin/file(1)
 version 
 4.12   i386  6.1-RELEASE-p3  SIGSEGV
 4.12   i386  6.1-RELEASE-p9  SIGSEGV
 4.12   i386  6.0-RELEASE-p14 SIGSEGV
 4.12   amd64 6.1-RELEASE-p7  Windows Enhanced Metafile (EMF) ...
 4.12   amd64 FreeBSD 6.2-RC1 Windows Enhanced Metafile (EMF) ...
 4.12   amd64 6.1-RELEASE-p9  Windows Enhanced Metafile (EMF) ...
 
 (file-4.18 and 4.19 work fine on all platforms)
 
 I recommend to use file(1) from ports for amavisd-new
 and similar content filters that rely on an up-to-date
 and stable version of file(1). The last SEGV I heard of
 was on 4.16.

From: Gabor Kovesdan <gabor@FreeBSD.org>
To: bug-followup@FreeBSD.org,  pol@leissner.se
Cc:  
Subject: Re: ports/106858: Extracted mime part of spam email makes file dump
 core
Date: Mon, 18 Dec 2006 16:16:32 +0100

 > But I now have /usr/local/bin/file at 4.19 and /usr/bin/file
 > at 4.12. What do I have to do to make the entire FreeBSD system
 > use /usr/local/bin/file (and the associated magic files of the
 > correct version) instead of /usr/bin/file? I can't move away from
 > x.x-RELEASE-pxx because of upgrading policy on production servers.
 > This goes beyond my usual cvsup, make buildworld/buildkernel/
 > installkernel/installworld cycle. Should I put all files from
 > file-4.19.tar into /usr/src/contrib/file and then run a make
 > buildworld and make installworld?
 
 I suggest you just deleting /usr/bin/file and symlinking 
 /usr/local/bin/file there. That's the simplest solution.
 
 Cheers,
 Gabor
Responsible-Changed-From-To: freebsd-ports-bugs->freebsd-bugs 
Responsible-Changed-By: arved 
Responsible-Changed-When: Mon Dec 18 15:26:10 UTC 2006 
Responsible-Changed-Why:  
Follow-ups indicate that it is a problem of file(1) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106858 
State-Changed-From-To: open->closed 
State-Changed-By: antoine 
State-Changed-When: Fri May 16 18:17:19 UTC 2008 
State-Changed-Why:  
Close: this problem is fixed in file(1) version 4.23. 
(merged in RELENG_6 and RELENG_7) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=106858 
>Unformatted:
