[tor-commits] [tor/maint-0.4.1] Merge branch 'tor-github/pr/1050' into maint-0.4.1
dgoulet at torproject.org
dgoulet at torproject.org
Tue Jun 11 15:39:17 UTC 2019
commit ea14fb136c6c771320d7c4ff6beab05d1dbc73aa
Merge: ce89fe36c 5068ccab0
Author: David Goulet <dgoulet at torproject.org>
Date: Tue Jun 11 11:29:46 2019 -0400
Merge branch 'tor-github/pr/1050' into maint-0.4.1
changes/ticket30686 | 5 +++++
src/lib/crypt_ops/crypto_rand_fast.c | 6 +++++-
src/lib/malloc/map_anon.c | 5 +++++
3 files changed, 15 insertions(+), 1 deletion(-)
diff --cc src/lib/crypt_ops/crypto_rand_fast.c
index c7f71a17c,d2ce1a542..e6ceb42cc
--- a/src/lib/crypt_ops/crypto_rand_fast.c
+++ b/src/lib/crypt_ops/crypto_rand_fast.c
@@@ -181,8 -181,12 +181,12 @@@ crypto_fast_rng_new_from_seed(const uin
#else
/* We decided above that noinherit would always do _something_. Assert here
* that we were correct. */
- tor_assert(inherit != INHERIT_RES_KEEP);
+ tor_assertf(inherit != INHERIT_RES_KEEP,
+ "We failed to create a non-inheritable memory region, even "
+ "though we believed such a failure to be impossible! This is "
+ "probably a bug in Tor support for your platform; please report "
+ "it.");
-#endif
+#endif /* defined(CHECK_PID) || ... */
return result;
}
diff --cc src/lib/malloc/map_anon.c
index 219bd706c,6afea713d..0f6a4150c
--- a/src/lib/malloc/map_anon.c
+++ b/src/lib/malloc/map_anon.c
@@@ -72,8 -68,13 +72,13 @@@
#define FLAG_NOINHERIT MADV_DONTFORK
#endif
-#endif
+#endif /* defined(HAVE_MINHERIT) || ... */
+ #if defined(HAVE_MINHERIT) && !defined(FLAG_ZERO) && !defined(FLAG_NOINHERIT)
+ #warn "minherit() is defined, but we couldn't find the right flag for it."
+ #warn "This is probably a bug in Tor's support for this platform."
+ #endif
+
/**
* Helper: try to prevent the <b>sz</b> bytes at <b>mem</b> from being swapped
* to disk. Return 0 on success or if the facility is not available on this
More information about the tor-commits
mailing list