Bug 1373107 - segfault in headerSigVerify()
segfault in headerSigVerify()
Status: VERIFIED
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: rpm (Show other bugs)
7.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Florian Festi
Jan Blazek
:
Depends On:
Blocks: 1380360 1371487
  Show dependency treegraph
 
Reported: 2016-09-05 04:41 EDT by Cedric Buissart
Modified: 2017-03-28 09:27 EDT (History)
0 users

See Also:
Fixed In Version: rpm-4.11.3-22.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Cedric Buissart 2016-09-05 04:41:50 EDT
Description of problem:

Corrupted RPM files may crash rpm in headerSigVerify()

Version-Release number of selected component (if applicable): all, including upstream


How reproducible: 100%


Steps to Reproduce:
1. corrupt an RPM file to add a DSA, RSA or SHA1 header flag that contains data outside of allocated memory (offset + length goes beyond data length)
2. rpm -qp <RPM>


Actual results:
Crash and/or valgrind warning, with the following trace :

==11445== Invalid read of size 8   
==11445==    at 0x4C2E25E: memcpy@@GLIBC_2.14 (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==11445==    by 0x4E62530: UnknownInlinedFun (string3.h:51)
==11445==    by 0x4E62530: headerSigVerify (package.c:240)
==11445==    by 0x4E62530: headerVerify (package.c:363)
==11445==    by 0x4E62915: rpmpkgReadHeader (package.c:457)
==11445==    by 0x4E62BEA: rpmpkgRead (package.c:578)
==11445==    by 0x4E6352D: rpmReadPackageFile (package.c:717)
==11445==    by 0x4E6EB81: rpmgiReadHeader (rpmgi.c:90)
==11445==    by 0x4E6EB81: rpmgiLoadReadHeader (rpmgi.c:126)
==11445==    by 0x4E6EB81: rpmgiNext (rpmgi.c:216)
==11445==    by 0x4E671D8: rpmgiShowMatches (query.c:274)
==11445==    by 0x4E671D8: rpmcliArgIter (query.c:518)
==11445==    by 0x4E672A6: rpmcliQuery (query.c:568)
==11445==    by 0x401918: main (rpmqv.c:304)

Expected results:
An error message about invalid header followed by graceful exit.

Additional info:
See https://bugzilla.redhat.com/show_bug.cgi?id=1371487

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