Bug 159405 - rpm --verify reports spurious md5 errors for empty files
Summary: rpm --verify reports spurious md5 errors for empty files
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Paul Nasrat
QA Contact: Mike McLean
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-06-02 14:01 UTC by Jonathan Kamens
Modified: 2007-11-30 22:11 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-12-12 20:07:28 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch not to try to mmap empty files (991 bytes, patch)
2005-06-02 14:01 UTC, Jonathan Kamens
no flags Details | Diff

Description Jonathan Kamens 2005-06-02 14:01:58 UTC
If you use "rpm --verify" on a package with empty files, rpm will report "?" 
in the MD5 column for the empty files.  This is because mmap files when you 
try to map a file of length zero.  Whether that failure is correct is, I 
suppose, a matter of some debate; the man page doesn't make it clear, although 
the specs may be clearer.  In any case, the attached patch eliminates the 
problem.

Comment 1 Jonathan Kamens 2005-06-02 14:01:58 UTC
Created attachment 115085 [details]
patch not to try to mmap empty files

Comment 2 Jordan Russell 2005-06-21 18:23:07 UTC
This started happening when I upgraded my custom kernel from 2.6.11 to 2.6.12.
It's also reproducable with kernel-2.6.11-1.1369_FC4.

It appears that this 'breakage' was deliberate, according to the ChangeLog for
2.6.12:

commit d11cf326bd5e785cc5a3f5a3d3f4e3a5522f4fb7
Author: Zhang Yanmin <yanmin.zhang>
Date:   Sun May 22 17:47:00 2005 -0700

    [IA64] sys_mmap doesn't follow posix.1 when parameter len=0
    
    In IA64 kernel, sys_mmap calls do_mmap2 and do_mmap2 returns addr if
    len=0, which means the mmap sys call succeeds.
    
    Posix.1 says:
    The mmap() function shall fail if:
    [EINVAL] The value of len is zero. 
    
    Here is a patch to fix it.
    
    Signed-off-by: Zhang Yanmin <yanmin.zhang>
    Acked-by: David Mosberger <davidm.com>
    Signed-off-by: Tony Luck <tony.luck>

Comment 3 Jonathan Kamens 2005-07-21 10:05:48 UTC
Real bug.  Affects security (since some people use rpm --verity regularly to
audit their systems, and this bug causes spurious output from rpm --verity). 
Reported over a month ago.  Fix included in bug report.  Can we please move this
along?


Comment 4 Jeff Johnson 2005-07-23 22:18:26 UTC
Fixed in rpm-4.4.2-1.

Comment 5 Chuck Wolber 2005-12-10 07:26:50 UTC
Shouldn't this be backported to RHEL 4 (RPM version 4.3.3) as well?

Comment 6 Paul Nasrat 2005-12-10 18:26:37 UTC
For consideration for RHEL please file an issue with support.

https://www.redhat.com/apps/support/

as described at https://bugzilla.redhat.com/

Comment 7 Jeff Johnson 2005-12-12 20:07:28 UTC
Well, there you have your answer!

Comment 8 Chuck Wolber 2005-12-13 00:09:50 UTC
Service request #766776 has been filed to request backporting this patch to RHEL 4.


Note You need to log in before you can comment on or make changes to this bug.