<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>62194</bug_id>
          
          <creation_ts>2004-08-30 01:12 0000</creation_ts>
          <short_desc>AIDE 0.10 segfault when doing --config-check</short_desc>
          <delta_ts>2004-09-18 07:29:57 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Applications</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>g.insolvibile@gmail.com</reporter>
          <assigned_to>forensics@gentoo.org</assigned_to>
          

      

      
          <long_desc isprivate="0">
            <who>g.insolvibile@gmail.com</who>
            <bug_when>2004-08-30 01:12:50 0000</bug_when>
            <thetext>aide 0.10 emerged with &quot;+crypt +nls -postgres +zlib&quot; on three different x86 boxes.

On all the boxes I get a segmentation fault when doing &quot;aide --config-check&quot;, with no output at all. On two out of three boxes, I got a segmentation fault also when doing &quot;aide --init&quot; (hence, aide is not usable). I was not able to find a difference between the two PCs where I get segfault on --init and the other one.

I traced the problem of the config-check segfault and reported it to the AIDE mailing list (see &quot;Segfault on Gentoo - fixed&quot; on https://mailman.cs.tut.fi/pipermail/aide/2004-August/thread.html). I am not sure whether it is just a bug in AIDE or also a missing mandatory configuration parameter in the 0.10 ebuild (--with-confighmackey, see the post for details). That is, it is not clear to me whether the HMAC key should be given always or not -- the AIDE documentation does not mention it at all.

Regarding the severity of the problem: if you have a machine where &quot;--init&quot; segfaults, the bug is indeed blocking. Otherwise, you can just avoid doing &quot;--config-check&quot; and you&apos;re done.

Reproducible: Always
Steps to Reproduce:
1. aide --config-check
2.
3.

Actual Results:  
golem ~ # aide --config-check
Segmentation fault


Expected Results:  
No segfault :)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ka0ttic@gentoo.org</who>
            <bug_when>2004-08-30 06:38:39 0000</bug_when>
            <thetext>Looks like app-crypt/mhash is to blame...

Core was generated by `aide --config-check&apos;.
Program terminated with signal 11, Segmentation fault.
#0  0x08059f7d in mhash (td=0x0, plaintext=0x8131728, size=1) at mhash.c:376
376             if (td-&gt;hash_func!=NULL)
(gdb) bt
#0  0x08059f7d in mhash (td=0x0, plaintext=0x8131728, size=1) at mhash.c:376
#1  0x0804d50a in conf_input_wrapper (buf=0x8131728 &quot;#&quot;, max_size=8192, in=0x8131590) at commandconf.c:231
#2  0x0804a325 in yy_get_next_buffer () at conf_lex.c:5339
#3  0x0804a0fe in conflex () at conf_lex.c:5174
#4  0x080484ba in confparse () at conf_yacc.c:1216
#5  0x0804d2d5 in commandconf (mode=68 &apos;D&apos;, line=0x80f6151 &quot;&quot;) at commandconf.c:165
#6  0x08059442 in main (argc=2, argv=0xbffff424) at aide.c:417

373     int mhash(MHASH td, const void *plaintext, size_t size)
374     {
375
376             if (td-&gt;hash_func!=NULL)
377                     td-&gt;hash_func( td-&gt;state, plaintext, size);
378
379             return 0;
380     }
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>g.insolvibile@gmail.com</who>
            <bug_when>2004-08-30 06:54:07 0000</bug_when>
            <thetext>mhash() does not like the NULL td pointer which is passed from aide: mhash can only be blamed for not being robust (a check on &apos;td&apos; would have been beneficial). Nevertheless, the original bug lies in aide, which is calling mhash() without having initialized the library (for details have a look into aide, src/commandconf.c, lines 203-232, or at my post to the AIDE mailing list).
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>squinky86@gentoo.org</who>
            <bug_when>2004-09-11 07:46:19 0000</bug_when>
            <thetext>The patch has been slightly modified and is now applied in the portage ebuild as even not having a key to check against should not cause a segfault. Do you have any suggestions on how to implement --with-confighmackey et al into the ebuild?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ka0ttic@gentoo.org</who>
            <bug_when>2004-09-17 08:37:18 0000</bug_when>
            <thetext>Created an attachment (id=39760)
aide-0.10-fix-config-check-segfault.patch

I still get a seg fault when running aide --config-check.  I found this patch
on
aide&apos;s SF bug tracker and after patching, it no longer dumps core.  It is
already
fixed in aide cvs.  Shall we include until next upstream release?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>dragonheart@gentoo.org</who>
            <bug_when>2004-09-17 17:00:50 0000</bug_when>
            <thetext>net-mon people - Hope you don&apos;t mind. The forensics herd has taken ownership of the aide package and will fix this bug and a few other aide bugs that exist.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ka0ttic@gentoo.org</who>
            <bug_when>2004-09-18 07:29:57 0000</bug_when>
            <thetext>dragonheart and I have cooked up a cvs snapshot and postgres patch (slightly modified from the patch submitted by Joshua Schmidlkofer in bug #37007) and have released aide-0.10_p20040917.  This should fix bugs 23764, 37007, and 62194.  Please test.</thetext>
          </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>39760</attachid>
            <date>2004-09-17 08:37 0000</date>
            <desc>aide-0.10-fix-config-check-segfault.patch</desc>
            <filename>aide-0.10-fix-config-check-segfault.patch</filename>
            <type>text/plain</type>
            <data encoding="base64">KioqIGNvbW1hbmRjb25mLmMJMjAwMy0xMS0wNCAxNjozOTo0OC4wMDAwMDAwMDAgKzAxMDAKLS0t
IC90bXAvYWlkZS0wLjEwL3NyYy9jb21tYW5kY29uZi5jCTIwMDMtMTItMDIgMTM6MDE6MDIuMDAw
MDAwMDAwICswMTAwCioqKioqKioqKioqKioqKgoqKiogMjIwLDIyNSAqKioqCi0tLSAyMjAsMjI2
IC0tLS0KICAJfQogICAgICAgIH0gZWxzZSB7CiAgCWNvbmYtPmRvX2NvbmZpZ21kPTA7CisgCXJl
dHVybiByZXR2YWw7CiAgICAgICAgfQogICAgICB9CiAgICAgIC8qIEZJWE1FIFRoaXMgZG9lcyBu
b3QgaGFuZGxlIHRoZSBjYXNlIHRoYXQgQEBlbmRfY29uZmlnIGlzIG9uIAo=
</data>        

          </attachment>
    </bug>

</bugzilla>