Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 25 Feb 2001 02:07:41 -0800 (PST)
From:      juraj@bednar.sk
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/25352: Libmcrypt crashes under certain circumstances (FreeBSD specific)
Message-ID:  <200102251007.f1PA7fE17674@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         25352
>Category:       ports
>Synopsis:       Libmcrypt crashes under certain circumstances (FreeBSD specific)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Feb 25 02:10:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     Juraj bednar
>Release:        4.2-STABLE (recent build)
>Organization:
>Environment:
FreeBSD ephex.factory.sk 4.2-STABLE FreeBSD 4.2-STABLE #3: Thu Feb 22 21:17:43 CET 2001     root@ephex.factory.sk:/usr/obj/usr/src/sys/EPHEX  i386

>Description:
Libmcrypt crashes when trying under PHP. I contacted Derick from the PHP team, gave him an
account on the machine and we debugged it together. He told, that this is Libmcrypt, not
PHP problem. Anyway, the same configuration and script runs under linux and other
operating systems. I tried versions 2.4.4 up to 2.4.9 of libmcrypt. 
>How-To-Repeat:
Compile mod_php4 with libmcrypt enabled and run this snippet of code in it:

      function make_tatra_sign( $value, $key) {

        // get the SHA1
        $hash = substr(mhash (MHASH_SHA1, $value), 0, 8);

        // encrypt hash with key
        $td = mcrypt_module_open(MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, "");
        $iv = mcrypt_create_iv(mcrypt_enc_get_iv_size ($td), MCRYPT_RAND);
        mcrypt_generic_init($td, $key, $iv);
        $signature = strtoupper(bin2hex(mcrypt_generic ($td, $hash)));
        mcrypt_generic_end ($td);

        return $signature;
      }

this gives the following backtrace:


                      #0  0x0 in ?? ()
                      #1  0x2842fa4a in mcrypt_enc_is_block_algorithm_mode () from /usr/local/lib/libmcrypt.so.5
                      #2  0x2842f4a9 in mcrypt_module_open () from /usr/local/lib/libmcrypt.so.5
                      #3  0x28334b87 in php_if_mcrypt_module_open (ht=4, return_value=0x827d20c, this_ptr=0x0,
                          return_value_used=1) at mcrypt.c:417
                      #4  0x2830fa09 in execute (op_array=0x828360c) at ./zend_execute.c:1519
                      #5  0x2830fc5c in execute (op_array=0x828380c) at ./zend_execute.c:1559
                      #6  0x2830fc5c in execute (op_array=0x828390c) at ./zend_execute.c:1559
                      #7  0x2830fc5c in execute (op_array=0x8283a0c) at ./zend_execute.c:1559
                      #8  0x2830fc5c in execute (op_array=0x825fc0c) at ./zend_execute.c:1559
                      #9  0x2831dc4e in zend_execute_scripts (type=8, file_count=3) at zend.c:729
                      #10 0x2832f0e4 in php_execute_script (primary_file=0xbfbff958) at main.c:1221
                      #11 0x2832b9e2 in apache_php_module_main (r=0x8269038, display_source_mode=0) at
                      sapi_apache.c:89
                      #12 0x2832c382 in send_php (r=0x8269038, display_source_mode=0, filename=0x0) at
                      mod_php4.c:516
                      #13 0x2832c3be in send_parsed_php (r=0x8269038) at mod_php4.c:527
                      #14 0x80536f8 in ap_invoke_handler ()
                      #15 0x80626b1 in process_request_internal ()
                      #16 0x8062710 in ap_process_request ()
                      #17 0x805c012 in child_main ()
                      #18 0x805c1a4 in make_child ()
                      #19 0x805c2c1 in startup_children ()
                      #20 0x805c790 in standalone_main ()
                      #21 0x805ce4b in main ()
                      #22 0x804fbf1 in _start ()

The PHP bug report announce is here:
http://bugs.php.net/bugs.php?id=9383&edit=1

Anyway, people don't like to fix this, as this is freebsd-only related.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200102251007.f1PA7fE17674>