Bug 159405 - rpm --verify reports spurious md5 errors for empty files
rpm --verify reports spurious md5 errors for empty files
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Paul Nasrat
Mike McLean
Depends On:
  Show dependency treegraph
Reported: 2005-06-02 10:01 EDT by Jonathan Kamens
Modified: 2007-11-30 17:11 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-12-12 15:07:28 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Jonathan Kamens 2005-06-02 10:01:58 EDT
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 
Comment 1 Jonathan Kamens 2005-06-02 10:01:58 EDT
Created attachment 115085 [details]
patch not to try to mmap empty files
Comment 2 Jordan Russell 2005-06-21 14:23:07 EDT
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

commit d11cf326bd5e785cc5a3f5a3d3f4e3a5522f4fb7
Author: Zhang Yanmin <yanmin.zhang@intel.com>
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@intel.com>
    Acked-by: David Mosberger <davidm@hpl.hp.com>
    Signed-off-by: Tony Luck <tony.luck@intel.com>
Comment 3 Jonathan Kamens 2005-07-21 06:05:48 EDT
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
Comment 4 Jeff Johnson 2005-07-23 18:18:26 EDT
Fixed in rpm-4.4.2-1.
Comment 5 Chuck Wolber 2005-12-10 02:26:50 EST
Shouldn't this be backported to RHEL 4 (RPM version 4.3.3) as well?
Comment 6 Paul Nasrat 2005-12-10 13:26:37 EST
For consideration for RHEL please file an issue with support.


as described at https://bugzilla.redhat.com/
Comment 7 Jeff Johnson 2005-12-12 15:07:28 EST
Well, there you have your answer!
Comment 8 Chuck Wolber 2005-12-12 19:09:50 EST
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.