Bug 1993242

Summary: "signature hdr data BAD" on trying to parse RPM with more than 64KB signature header
Product: Red Hat Enterprise Linux 7 Reporter: Patrick Uiterwijk <puiterwijk>
Component: rpmAssignee: Michal Domonkos <mdomonko>
Status: CLOSED ERRATA QA Contact: Jan Blazek <jblazek>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.9CC: alex.iribarren, anwa, blc, chaekim, igulina, jpazdziora, jreznik, mdomonko, rmcgover, wcheang
Target Milestone: rcKeywords: Triaged, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rpm-4.11.3-46.el7_9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-10-12 15:30:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Patrick Uiterwijk 2021-08-12 15:39:45 UTC
Description of problem:
RPM on RHEL7 only accepts at most 64KB signature header size, contrary to the documented (upstream) 64MB size.

Version-Release number of selected component (if applicable):
rpm-4.11.3-45.el7.x86_64

How reproducible:
Consistent

Steps to Reproduce:
1. Get an RPM with a larger than 64KB
2. Run anything on that RPM that tries to parse it (rpm -Kv, rpm -ivh, dnf install)

Actual results:
error: python3-mechanize-0.4.5-4.fc34.noarch.rpm: signature hdr data: BAD, no. of bytes(19088) out of range


Expected results:
The RPM should get successfully processed.

Additional info:
This is fixed upstream to the documented behaviour by https://github.com/rpm-software-management/rpm/pull/1252 .
This is a RHEL7 duplicate of 1918777.

Acceptance Criteria:
RPM understands packages with a signature header exceeding 64KB.  This can be verified by IMA-signing a package with RPM version 4.16 (e.g. on a recent Fedora version) - that's because since 4.15, file signatures are stored in the signature header.  The test case from Bug 1896046 can be reused here.

Comment 12 Brian Stinson 2021-10-11 20:49:07 UTC
*** Bug 2012919 has been marked as a duplicate of this bug. ***

Comment 13 Alex Iribarren 2021-10-12 07:20:07 UTC
This still seems to fail on CentOS 8.3:

 ~ > rpm -qip http://linuxsoft.cern.ch/centos-stream/9-stream/BaseOS/aarch64/os/Packages/bash-5.1.8-2.el9.aarch64.rpm
error: /var/tmp/rpm-tmp.HGmeBg: signature hdr data: BAD, no. of bytes(31000) out of range
error: http://linuxsoft.cern.ch/centos-stream/9-stream/BaseOS/aarch64/os/Packages/bash-5.1.8-2.el9.aarch64.rpm: not an rpm package (or package manifest)
 ~ > rpm -q rpm
rpm 4.14.2-37.el8 aarch64

Comment 16 errata-xmlrpc 2021-10-12 15:30:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rpm bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2021:3805