]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge branch 'tor-github/pr/1050' into maint-0.4.1
authorDavid Goulet <dgoulet@torproject.org>
Tue, 11 Jun 2019 15:29:46 +0000 (11:29 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 11 Jun 2019 15:29:46 +0000 (11:29 -0400)
1  2 
src/lib/crypt_ops/crypto_rand_fast.c
src/lib/malloc/map_anon.c

index c7f71a17c91c0d9dc0a87fe84e41faa161b0c1d4,d2ce1a542fc5b35799c9464dece00584cbb2f820..e6ceb42ccbd9f79a965fc384b919330afc89c547
@@@ -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;
  }
  
index 219bd706cc3edcfe6a37eadd1d185eb60606d0b2,6afea713dfb9e75ef598319a46bd66a6b68dea20..0f6a4150c7551786680402ec7394f867ca69b211
  #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