Bug 987463 - Cannot add a child to a node that uses ri-records (hivex_node_add_child: Assertion `old_offs != 0' failed.)
Cannot add a child to a node that uses ri-records (hivex_node_add_child: Asse...
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: hivex (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Richard W.M. Jones
Fedora Extras Quality Assurance
:
Depends On:
Blocks: 986473
  Show dependency treegraph
 
Reported: 2013-07-23 08:37 EDT by Richard W.M. Jones
Modified: 2013-08-03 19:59 EDT (History)
2 users (show)

See Also:
Fixed In Version: hivex-1.3.8-1.fc19
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-07-25 18:34:45 EDT
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 Richard W.M. Jones 2013-07-23 08:37:16 EDT
Description of problem:

hivex segfaults with an assert fail if you try to add a child
node to certain registry keys.  I have a test registry (which
I cannot release) which exhibits this problem:

  $ hivexsh -w SYSTEM

  Welcome to hivexsh, the hivex interactive shell for examining
  Windows Registry binary hive files.
  
  Type: 'help' for help summary
        'quit' to quit the shell
  
  SYSTEM\> cd \ControlSet001\Control\CriticalDeviceDatabase
  SYSTEM\ControlSet001\Control\CriticalDeviceDatabase> add pci#ven_1af4&dev_1001&subsys_00000000
  hivexsh: hivex.c:2476: hivex_node_add_child: Assertion `old_offs != 0' failed.
  Aborted (core dumped)

(3) hivexsh will segfault and (if configured right) will core dump.

The stack trace is:

#0  0x0000003f2ca35a19 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x0000003f2ca37128 in __GI_abort () at abort.c:90
#2  0x0000003f2ca2e986 in __assert_fail_base (
    fmt=0x3f2cb7d3e8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x3f3ae0a6e8 "old_offs != 0", 
    file=file@entry=0x3f3ae0a64d "hivex.c", line=line@entry=2476, 
    function=function@entry=0x3f3ae0cc00 <__PRETTY_FUNCTION__.6331> "hivex_node_add_child") at assert.c:92
#3  0x0000003f2ca2ea32 in __GI___assert_fail (
    assertion=assertion@entry=0x3f3ae0a6e8 "old_offs != 0", 
    file=file@entry=0x3f3ae0a64d "hivex.c", line=line@entry=2476, 
    function=function@entry=0x3f3ae0cc00 <__PRETTY_FUNCTION__.6331> "hivex_node_add_child") at assert.c:101
#4  0x0000003f3ae05dd2 in hivex_node_add_child (h=h@entry=0xf19030, 
    parent=119928, 
    name=name@entry=0xf2ccc4 "pci#ven_1af4&dev_1001&subsys_00000000")
    at hivex.c:2476
#5  0x0000000000402270 in cmd_add (
    name=0xf2ccc4 "pci#ven_1af4&dev_1001&subsys_00000000") at hivexsh.c:1099
#6  dispatch (args=0xf2ccc4 "pci#ven_1af4&dev_1001&subsys_00000000", 
    cmd=0xf2ccc0 "add") at hivexsh.c:424
#7  main (argc=<optimized out>, argv=<optimized out>) at hivexsh.c:214

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

hivex 1.3.7 & hivex from git both test, both fail

How reproducible:

100%

Steps to Reproduce:

(Will come later once I have a scrubbed registry which
I can release).
Comment 1 Richard W.M. Jones 2013-07-25 06:39:49 EDT
19 part patch posted upstream:

https://www.redhat.com/archives/libguestfs/2013-July/thread.html#00026
Comment 2 Richard W.M. Jones 2013-07-25 18:34:45 EDT
This should be fixed in hivex 1.3.8 which is available here:
http://libguestfs.org/download/hivex/
and in Fedora Rawhide.
Comment 3 Fedora Update System 2013-07-26 04:46:58 EDT
hivex-1.3.8-1.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/hivex-1.3.8-1.fc19
Comment 4 Fedora Update System 2013-08-03 19:59:43 EDT
hivex-1.3.8-1.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.

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