Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
Trac
Trac
  • Project overview
    • Project overview
    • Details
    • Activity
  • Issues 246
    • Issues 246
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Create a new issue
  • Issue Boards

GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

  • Legacy
  • TracTrac
  • Issues
  • #30614

Closed (moved)
Open
Opened May 25, 2019 by riastradh@riastradh

Use MAP_INHERIT_NONE/ZERO if available instead of crashing on assertion failure

On NetBSD, the way to ask a page range be zero'd or unmapped on fork is minherit(addr, nbytes, MAP_INHERIT_ZERO) or minherit(addr, nbytes, MAP_INHERIT_NONE). However,

  • map_anon.c does not actually check for or use MAP_INHERIT_ZERO or MAP_INHERIT_NONE, so
  • FLAG_NOINHERIT is undefined, so
  • tor_mmap_anonymous fails to disinherit the mapping, so
  • crypto_fast_rng_new_from_seed throws a fit.
slow/prob_distr/stochastic_log_logistic: [forking] May 25 03:56:58.091 [err] tor_assertion_failed_(): Bug: src/lib/crypt_ops/crypto_rand_fast.c:184: crypto_fast_rng_new_from_seed: Assertion inherit != INHERIT_RES_KEEP failed; aborting. (on Tor 0.4.1.1-alpha-dev 29955f13e5bc8e61)
May 25 03:56:58.091 [err] Bug: Assertion inherit != INHERIT_RES_KEEP failed in crypto_fast_rng_new_from_seed at src/lib/crypt_ops/crypto_rand_fast.c:184: . (Stack trace not available) (on Tor 0.4.1.1-alpha-dev 29955f13e5bc8e61)
[Lost connection!]

The attached patch checks for and uses MAP_INHERIT_ZERO and MAP_INHERIT_NONE. However, it does not adjust the code path that gets confused if tor_mmap_anonymous fails to disinherit the mapping, which might be worth doing too, perhaps earlier on by detecting and noisily reporting a lack of support for cutting off the hereditary concentration of wealth, or at least secrets, in society before it's too late.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Tor: 0.4.0.x-final
Milestone
Tor: 0.4.0.x-final
Assign milestone
Time tracking
None
Due date
None
Reference: legacy/trac#30614