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

Ticket29668: fork improvements for fast_prng #761

Merged
merged 7 commits into from Apr 5, 2019

Conversation

Labels
None yet
Projects
None yet
3 participants
@nmathewson
Copy link
Contributor

@nmathewson nmathewson commented Mar 6, 2019

No description provided.

@coveralls
Copy link

@coveralls coveralls commented Mar 6, 2019

Pull Request Test Coverage Report for Build 4570

  • 11 of 14 (78.57%) changed or added relevant lines in 3 files are covered.
  • 11 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 62.236%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/lib/malloc/map_anon.c 7 8 87.5%
src/lib/crypt_ops/crypto_rand_fast.c 3 5 60.0%
Files with Coverage Reduction New Missed Lines %
src/core/or/circuitpadding.c 11 91.02%
Totals Coverage Status
Change from base Build 4540: -0.008%
Covered Lines: 46166
Relevant Lines: 74179

💛 - Coveralls

nmathewson added 7 commits Apr 4, 2019
This will cause the child process to construct a new one in a nice
safe way.

Closes ticket 29668; bug not in any released Tor.
Previously we did this for tests only, but it's valuable for getting
proper fork behavior in rand_fast.
getpid() can be really expensive sometimes, and it can fail to
detect some kind of fork+prng mistakes, so we need to avoid it if
it's safe to do so.

This patch might slow down fast_prng a lot on any old operating
system that lacks a way to prevent ram from being inherited, AND
requires a syscall for any getpid() calls.  But it should make sure
that we either crash or continue safely on incorrect fork+prng usage
elsewhere in the future.
@torproject-pusher torproject-pusher merged commit 76912bf into torproject:master Apr 5, 2019
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment