Bug 888379

Summary: RFE: improve Hivex component's robustness for processing improper registries
Product: [Community] Virtualization Tools Reporter: skippyvondrake
Component: hivexAssignee: Richard W.M. Jones <rjones>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: mbooth, ptoscano, rbalakri, rjones
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-02-17 10:31:01 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:
Bug Depends On:    
Bug Blocks: 1311890, 1423436    

Description skippyvondrake 2012-12-18 15:30:52 UTC
Description of problem:
I have a Windows 7 image that can be booted in Xen, but upon startup (in Xen) a "Registry Recovery... recovery was successful" message appears. After which the VM runs as expected.

If I use libguestfs on this same image and call guestfs_inspect_os() to obtain the "roots", the hivex component fails because of the unexpected (and corrupted to some degree) registry. Subsequently guestfs_inspect_os cannot return "roots".


How reproducible: Very - with the specific input image. I may be able to provide it. (about 20GB).

Steps to Reproduce:
1. load specific image with guestfs and call guestfs_inspect_os()

Additional info:
This feature request was initially and incorrectly posted as a bug (reference:https://bugzilla.redhat.com/show_bug.cgi?id=888059 for more details)

Richard Jones pointed out this debug info as indicative of the registry problem:
"hivex: /sysroot/Windows/System32/config/SOFTWARE: trailing garbage at end of file (at 0x245b000, after 8557 pages)"

He also mentioned that there might be empty trailing hbins at the end of the registry which caused problems for the hivex component.

If there is a place available for me to upload my Windows 7 image (approx. 20GB) then I'd be willing to provide it for the purpose of addressing this feature request only.

Comment 1 Richard W.M. Jones 2012-12-18 16:14:15 UTC
I suggested some sort of looser checking flag, eg:
HIVEX_OPEN_FIXUP.  This means we wouldn't automatically
"fix" things, but would let us deal with this problem.