Merge pull request #42150 from dtzWill/fix/libgcrypt-locking-badness
libgcrypt: fix bad locking behavior introduced in update
This commit is contained in:
commit
1a1fdaa9d2
2 changed files with 33 additions and 2 deletions
|
@ -21,6 +21,9 @@ stdenv.mkDerivation rec {
|
||||||
# The build enables -O2 by default for everything else.
|
# The build enables -O2 by default for everything else.
|
||||||
hardeningDisable = stdenv.lib.optional stdenv.cc.isClang "fortify";
|
hardeningDisable = stdenv.lib.optional stdenv.cc.isClang "fortify";
|
||||||
|
|
||||||
|
# Accepted upstream, should be in next update: #42150, https://dev.gnupg.org/T4034
|
||||||
|
patches = [ ./fix-jent-locking.patch ];
|
||||||
|
|
||||||
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
||||||
|
|
||||||
buildInputs = [ libgpgerror ]
|
buildInputs = [ libgpgerror ]
|
||||||
|
@ -49,8 +52,7 @@ stdenv.mkDerivation rec {
|
||||||
cp src/.libs/libgcrypt.20.dylib $out/lib
|
cp src/.libs/libgcrypt.20.dylib $out/lib
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# TODO: reenable with next update?
|
doCheck = true;
|
||||||
doCheck = !stdenv.isDarwin;
|
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
homepage = https://www.gnu.org/software/libgcrypt/;
|
homepage = https://www.gnu.org/software/libgcrypt/;
|
||||||
|
|
29
pkgs/development/libraries/libgcrypt/fix-jent-locking.patch
Normal file
29
pkgs/development/libraries/libgcrypt/fix-jent-locking.patch
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
From bbe989be6ca5e093d5244413590bd80e12c2ec9b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Will Dietz <w@wdtz.org>
|
||||||
|
Date: Sun, 17 Jun 2018 18:53:58 -0500
|
||||||
|
Subject: [PATCH] rndjent: move locking to fix trying to obtain held lock,
|
||||||
|
hanging
|
||||||
|
|
||||||
|
---
|
||||||
|
random/rndjent.c | 3 ++-
|
||||||
|
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/random/rndjent.c b/random/rndjent.c
|
||||||
|
index 0c5a820b..3740ddd4 100644
|
||||||
|
--- a/random/rndjent.c
|
||||||
|
+++ b/random/rndjent.c
|
||||||
|
@@ -334,9 +334,10 @@ _gcry_rndjent_get_version (int *r_active)
|
||||||
|
{
|
||||||
|
if (r_active)
|
||||||
|
{
|
||||||
|
- lock_rng ();
|
||||||
|
/* Make sure the RNG is initialized. */
|
||||||
|
_gcry_rndjent_poll (NULL, 0, 0);
|
||||||
|
+
|
||||||
|
+ lock_rng ();
|
||||||
|
/* To ease debugging we store 2 for a clock_gettime based
|
||||||
|
* implementation and 1 for a rdtsc based code. */
|
||||||
|
*r_active = jent_rng_collector? is_rng_available () : 0;
|
||||||
|
--
|
||||||
|
2.18.0-rc2
|
||||||
|
|
Loading…
Reference in a new issue