[gnutls-devel] crash inside of wrap_nettle_rnd?

Jason A. Donenfeld Jason at zx2c4.com
Thu Feb 13 00:04:30 CET 2014


Okay, this awful awful patch "fixes" the weechat crashes. I'm sure
this is crippling security, as it essentially destroys any proper
respect for the locks, but...

Anyway, I'll leave it to the gnutls and weechat devs to get to the
bottom of this; I'm way over my head right now. My best guess right
now would be that gnutls isn't properly initializing some sort of
pthread struct, and it's an old bug, but one that is only triggered by
the heap setup of recent versions of weechat. This would account for
the PTHREAD_PRIO_PROTECT related error.

stern ~ # cat /etc/portage/patches/net-libs/gnutls/rnd-mutex-crash-hack.patch
Only in gnutls-3.2.10-modified: cscope.out
diff -ru gnutls-3.2.10/lib/nettle/rnd.c gnutls-3.2.10-modified/lib/nettle/rnd.c
--- gnutls-3.2.10/lib/nettle/rnd.c      2014-01-27 19:27:10.000000000 +0100
+++ gnutls-3.2.10-modified/lib/nettle/rnd.c     2014-02-12
23:54:34.926144545 +0100
@@ -42,8 +42,8 @@

 #define SOURCES 2

-#define RND_LOCK if (gnutls_mutex_lock(&rnd_mutex)!=0) abort()
-#define RND_UNLOCK if (gnutls_mutex_unlock(&rnd_mutex)!=0) abort()
+#define RND_LOCK gnutls_mutex_lock(&rnd_mutex)
+#define RND_UNLOCK gnutls_mutex_unlock(&rnd_mutex)

 enum {
        RANDOM_SOURCE_TRIVIA = 0,



More information about the Gnutls-devel mailing list