httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 52473] Patch to integrate apache server with OpenSSL generic PKCS#11 engine.
Date Fri, 24 May 2013 08:48:22 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=52473

--- Comment #6 from Rico Huijbers <rix0rrr@gmail.com> ---
I have some problems with this patch: Apache (2.2) hangs during startup,
seemingly due to a double-locking issue. Stack trace attached below.

ENGINE_init (#23) acquires a lock, but then later in engine_table_select (#7)
the thread tries to acquire the same lock again and deadlocks.

It's hard to say which piece of code is at fault here. OpenSC seems to be the
most likely candidate, but then again it simply calls into libssl via a public
API that has no unlocked variant, and I imagine that if the lock wasn't already
held it should be acquired at that point. Anyway, tread carefully.

Software involved:

- Apache 2.2.22-6ubuntu5
- libssl 1.0.1c-4ubuntu8
- libopensc 0.13.0-0-git20121129101055
- libp11 0.2.8-2build1

------------------

#0  0xb776c424 in __kernel_vsyscall ()
#1  0xb76bb4d2 in __lll_lock_wait () from /lib/i386-linux-gnu/libpthread.so.0
#2  0xb76b6ed4 in _L_lock_776 () from /lib/i386-linux-gnu/libpthread.so.0
#3  0xb76b6d13 in pthread_mutex_lock () from
/lib/i386-linux-gnu/libpthread.so.0
#4  0xb76e07d0 in apr_thread_mutex_lock () from /usr/lib/libapr-1.so.0
#5  0xb7380617 in ssl_util_thr_lock () from /usr/lib/apache2/modules/mod_ssl.so
#6  0xb718f9f5 in CRYPTO_lock (mode=mode@entry=9, type=type@entry=30,
file=file@entry=0xb72a73f4 "eng_table.c", line=line@entry=258) at
cryptlib.c:604
#7  0xb71fc077 in engine_table_select (table=table@entry=0xb72fe8d4
<cipher_table>, nid=nid@entry=418) at eng_table.c:258
#8  0xb71fdb55 in ENGINE_get_cipher_engine (nid=418) at tb_cipher.c:115
#9  0xb72118c2 in EVP_CipherInit_ex (ctx=ctx@entry=0xbf89b7c0,
cipher=cipher@entry=0xb72ef9e0 <aes_128_ecb>, impl=impl@entry=0x0,
key=key@entry=0xb6e60068
"\001\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020\001\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020\277\303)\021\307\030\303@",
iv=iv@entry=0xbf89b84c "", enc=enc@entry=1) at evp_enc.c:147
#10 0xb7211a33 in EVP_EncryptInit_ex (ctx=0xbf89b7c0, cipher=0xb72ef9e0
<aes_128_ecb>, impl=0x0, key=0xb6e60068
"\001\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020\001\002\003\004\005\006\a\b\t\n\v\f\r\016\017\020\277\303)\021\307\030\303@",
iv=0xbf89b84c "") at evp_enc.c:292
#11 0xb6d63aa3 in ?? () from /usr/lib/libopensc.so.3
#12 0xb6d65aa5 in ?? () from /usr/lib/libopensc.so.3
#13 0xb6d66d05 in ?? () from /usr/lib/libopensc.so.3
#14 0xb6d670f7 in ?? () from /usr/lib/libopensc.so.3
#15 0xb6d6729f in ?? () from /usr/lib/libopensc.so.3
#16 0xb6d01c85 in sc_connect_card () from /usr/lib/libopensc.so.3
#17 0xb6fcdadd in ?? () from /usr/lib/opensc-pkcs11.so
#18 0xb6fce076 in ?? () from /usr/lib/opensc-pkcs11.so
#19 0xb6fc9521 in ?? () from /usr/lib/opensc-pkcs11.so
#20 0xb703d973 in PKCS11_CTX_load () from /usr/lib/i386-linux-gnu/libp11.so.2
#21 0xb704cdde in ?? () from /usr/lib/engines/engine_pkcs11.so
#22 0xb71fae8b in engine_unlocked_init (e=e@entry=0xb8c383f8) at eng_init.c:67
#23 0xb71fb000 in ENGINE_init (e=0xb8c383f8) at eng_init.c:130
#24 0xb736a68a in ssl_ossle_get_engine () from
/usr/lib/apache2/modules/mod_ssl.so
#25 0xb736b03f in ssl_init_Engine () from /usr/lib/apache2/modules/mod_ssl.so
#26 0xb736ae1d in ssl_init_Module () from /usr/lib/apache2/modules/mod_ssl.so
#27 0xb77c51ee in ap_run_post_config (pconf=pconf@entry=0xb7492018,
plog=0xb7460018, ptemp=0xb745e018, s=s@entry=0xb748c6a8) at config.c:95
#28 0xb77ae587 in main (argc=3, argv=0xbf89c464) at main.c:688

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message