Bug 1805467

Summary: TypeError handling PEheader during File Collection results in discarding data for *all* files.
Product: Red Hat CloudForms Management Engine Reporter: Jerry Keselman <jkeselma>
Component: SmartState AnalysisAssignee: Jerry Keselman <jkeselma>
Status: CLOSED ERRATA QA Contact: Niyaz Akhtar Ansari <nansari>
Severity: high Docs Contact: Red Hat CloudForms Documentation <cloudforms-docs>
Priority: high    
Version: unspecifiedCC: akarol, dmetzger, obarenbo, sbulage, simaishi
Target Milestone: GAKeywords: ZStream
Target Release: 5.11.5Flags: pm-rhel: cfme-5.11.z+
Hardware: All   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.11.5.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-05 13:43:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: Bug
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: CFME Core Target Upstream Version:
Embargoed:
Bug Depends On: 1824259    
Bug Blocks:    

Description Jerry Keselman 2020-02-20 20:31:52 UTC
Description of problem:

If a TypeError is encountered while reading the importList from the file's PEheader, the exception is currently not handled, and consequently the data collected from *all* files is discarded and no file information is available.

Version-Release number of selected component (if applicable):


How reproducible:

This occurs only for Windows virtual machines.  If the file to be collected contains imports, on rare occasion while computing the end of the name in the PEheader.getImports method invalid data is encountered in the file resulting in a TypeError.  This is difficult to reproduce on demand.  An example of the relevant stack trace is:

/usr/local/rvm/gems/ruby-2.6.3/gems/manageiq-smartstate-0.5.0/lib/metadata/util/win32/peheader.rb:152:in `+'
/usr/local/rvm/gems/ruby-2.6.3/gems/manageiq-smartstate-0.5.0/lib/metadata/util/win32/peheader.rb:152:in `block in getImports'
/usr/local/rvm/gems/ruby-2.6.3/gems/manageiq-smartstate-0.5.0/lib/metadata/util/win32/peheader.rb:140:in `loop'
/usr/local/rvm/gems/ruby-2.6.3/gems/manageiq-smartstate-0.5.0/lib/metadata/util/win32/peheader.rb:140:in `getImports'
/usr/local/rvm/gems/ruby-2.6.3/gems/manageiq-smartstate-0.5.0/lib/metadata/util/win32/peheader.rb:94:in `imports'
/usr/local/rvm/gems/ruby-2.6.3/gems/manageiq-smartstate-0.5.0/lib/metadata/util/md5deep.rb:166:in `processFile'
/usr/local/rvm/gems/ruby-2.6.3/gems/manageiq-smartstate-0.5.0/lib/metadata/util/md5deep.rb:81:in `block in scan_glob

Steps to Reproduce:
1. Run SmartState Analysis on a Windows VM containing the invalid files as described above.
2. Set up a collection profile that requests file data from the relevant file.
3.

Actual results:

No data is collected from any files on the virtual Machine.


Expected results:

Data is collected from all requested files.


Additional info:

Comment 3 Jerry Keselman 2020-02-26 15:34:40 UTC
Fixed by https://github.com/ManageIQ/manageiq-smartstate/pull/111 - still waiting final merge.

Comment 4 Jerry Keselman 2020-02-26 16:54:31 UTC
Merged.  Moving to POST.

Comment 6 Satoe Imaishi 2020-04-03 13:34:50 UTC
https://github.com/ManageIQ/manageiq/pull/20025

Comment 10 errata-xmlrpc 2020-05-05 13:43:11 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, 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-2020:2020