aboutsummaryrefslogtreecommitdiff
path: root/src/lib/malloc
AgeCommit message (Collapse)Author
2019-09-30Re-run "make autostyle" with improved annotate_ifdef_directivesNick Mathewson
2019-09-16Run "make autostyle" and fix wide lines.Nick Mathewson
2019-09-16Merge branch 'tor-github/pr/1318'George Kadianakis
2019-09-11madvise: tolerate EINVAL and ENOSYS when minherit failsNick Mathewson
These errors can occur if we are built on a system with support for madvise(MADV_NOFORK) but then we are run on a system whose kernel does not support that flag. If the error is something that we don't tolerate at all, we now log it before crashing. Fixes bug 31696. I am calling this a bugfix on 0.4.1.1-alpha, where we actually started using the map_anon code. This is similar to, but not the same as, the fix for #31570.
2019-09-02madvise: tolerate EINVAL and ENOSYSNick Mathewson
These errors can occur if we are built on a system with support for madvise(MADV_NOFORK) but then we are run on a system whose kernel does not support that flag. If the error is something that we don't tolerate at all, we now log it before crashing. Fixes bug 31570. I am calling this a bugfix on 0.4.1.1-alpha, where we actually started using the map_anon code.
2019-06-11Merge branch 'tor-github/pr/1050' into maint-0.4.1David Goulet
2019-06-11Give a compile warning when we don't have any flags for minherit().Nick Mathewson
Part of ticket 30686.
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-30Merge branch 'tor-github/pr/1049'David Goulet
2019-05-29Use MAP_INHERIT_ZERO or MAP_INHERIT_NONE if available.Taylor R Campbell
Fixes assertion failure in tests on NetBSD: 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!]
2019-05-02Add comments to include.am files to note where new sources goNick Mathewson
This mechanism isn't perfect, and sometimes it will guess wrong, but it will help our automation.
2019-04-04Use an enum for inherit_result_out.Nick Mathewson
2019-04-04rename inherit values to avoid conflict with system definesNick Mathewson
2019-04-04map_anon: define a macro if it is possible for noinherit to fail.Nick Mathewson
2019-04-04Make map_anon expose the result of a noinherit attemptNick Mathewson
Previously we did this for tests only, but it's valuable for getting proper fork behavior in rand_fast.
2019-02-25Re-enable and fix unit test for nofork mappingsNick Mathewson
This test was previously written to use the contents of the system headers to decide whether INHERIT_NONE or INHERIT_ZERO was going to work. But that won't work across different environments, such as (for example) when the kernel doesn't match the headers. Instead, we add a testing-only feature to the code to track which of these options actually worked, and verify that it behaved as we expected. Closes ticket 29541; bugfix not on any released version of Tor.
2019-02-06Code for anonymous mappings via mmap() or CreateFileMapping().Nick Mathewson
Using an anonymous mmap() is a good way to get pages that we can set kernel-level flags on, like minherit() or madvise() or mlock(). We're going to use that so that we can make uninheritable locked pages to store PRNG data.
2019-01-16Bump copyright date to 2019Nick Mathewson
2018-11-14Normalize .may_include to always have paths, and paths to includeNick Mathewson
2018-07-10Rename util_malloc to malloc.Nick Mathewson
2018-07-05Move openbsd-malloc responsibility to lib/mallocNick Mathewson
(Note that this is not believed to work, but we may as well have it in the right place till we remove it)
2018-07-03Remove ATTR_NONNULL macrorl1987
2018-06-22Split container.c based on container types, and minimize includesNick Mathewson
Minimizing includes revealed other places includes were necessary.
2018-06-21Extract tor_malloc and friends to a new module.Nick Mathewson