Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket30686 #1050

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions changes/ticket30686
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
o Minor features (logging):
- Give a more useful assertion failure message if we think we have
minherit() but we fail to make a region non-inheritable. Give a
compile-time warning if our support for minherit() is
incomplete. Closes ticket 30686.
6 changes: 5 additions & 1 deletion src/lib/crypt_ops/crypto_rand_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,11 @@ crypto_fast_rng_new_from_seed(const uint8_t *seed)
#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
return result;
}
Expand Down
5 changes: 5 additions & 0 deletions src/lib/malloc/map_anon.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@

#endif

#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
Expand Down