summaryrefslogtreecommitdiff
path: root/src/lib
AgeCommit message (Collapse)Author
2019-09-17Merge branch 'bug31570_041' into maint-0.4.1Nick Mathewson
2019-09-17Merge branch 'maint-0.4.0' into maint-0.4.1Nick Mathewson
2019-09-17Merge branch 'maint-0.3.5' into maint-0.4.0Nick Mathewson
2019-09-17Merge remote-tracking branch 'tor-github/pr/1307' into maint-0.3.5Nick Mathewson
2019-09-17Merge branch 'maint-0.4.0' into maint-0.4.1Nick Mathewson
2019-09-12Ticket 31687: fix for tor_isinf() as wellNick Mathewson
tor_isinf() was new in 0.4.0, and also needs to look at the same rules as clamp_double_to_i64()
2019-09-12Merge branch 'ticket31687_035' into ticket31687_040Nick Mathewson
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-10fp.c: Suppress float-conversion warnings on FreeBSD.Nick Mathewson
We used to do this on Windows only, but it appears to affect multiple platforms when building with certain versions of GCC, and a common pattern for defining the floating-point classifier functions. Fixes part of 31687. I'm calling this a bugfux on 31687, when we started suppressing these warnings on Windows.
2019-09-09build: The <sys/sysctl.h> is now deprecated on LinuxDavid Goulet
Closes #31673
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-08-12Merge branch 'maint-0.3.5' into maint-0.4.0teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/1049' into maint-0.4.0teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/952' into maint-0.3.5teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/951' into maint-0.3.5teor
2019-08-12Merge remote-tracking branch 'tor-github/pr/911' into maint-0.3.5teor
2019-08-10Merge branch 'maint-0.3.5' into maint-0.4.0teor
2019-08-09Merge remote-tracking branch 'tor-github/pr/1054' into maint-0.3.5teor
2019-08-09Merge remote-tracking branch 'tor-github/pr/920' into maint-0.3.5teor
2019-08-09Merge remote-tracking branch 'tor-github/pr/763' into maint-0.3.5teor
2019-08-09Merge branch 'bug31343_31374_035' into bug31343_31374_040teor
2019-08-08Merge branch 'ticket31374_035' into maint-0.4.1Nick Mathewson
2019-08-08Merge branch 'ticket31374_029' into ticket31374_035Nick Mathewson
2019-07-29Merge branch 'tor-github/pr/1179' into maint-0.4.1David Goulet
2019-07-24Fix clang-detected errors related to log_domain_mask_tNick Mathewson
2019-07-19Extract the log_domain_t type to a lower-level headerNick Mathewson
This way, both err and log may depend on it.
2019-07-19Prevent UB on signed overflow.Tobias Stoeckmann
Overflowing a signed integer in C is an undefined behaviour. It is possible to trigger this undefined behaviour in tor_asprintf on Windows or systems lacking vasprintf. On these systems, eiter _vscprintf or vsnprintf is called to retrieve the required amount of bytes to hold the string. These functions can return INT_MAX. The easiest way to recreate this is the use of a specially crafted configuration file, e.g. containing the line: FirewallPorts AAAAA<in total 2147483610 As> This line triggers the needed tor_asprintf call which eventually leads to an INT_MAX return value from _vscprintf or vsnprintf. The needed byte for \0 is added to the result, triggering the overflow and therefore the undefined behaviour. Casting the value to size_t before addition fixes the behaviour. Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
2019-07-08Adjust log callback type to use log_domain_mask_tNick Mathewson
2019-07-08Add a compile-time assertion to prevent a recurrence of 31080.Nick Mathewson
2019-07-08Use a 64-bit mask for log domains, and fix a conflictNick Mathewson
When we added LD_MESG, we created a conflict with the LD_NO_MOCK flag. We now need 64 bits for log domains in order to fix this issue. Fixes bug 31080; bugfix on 0.4.1.1-alpha.
2019-07-08Move declaration of LD_NO_MESG to make conflict more apparent.Nick Mathewson
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-11Give a more useful failure messgae when we fail to minherit().Nick Mathewson
Part of ticket 30686.
2019-06-05Merge remote-tracking branch 'tor-github/pr/952' into maint-0.4.0Nick Mathewson
2019-06-05Replace a missing end-of-comment stringNick Mathewson
This happened when I went to fix long lines after running "make autostyle".
2019-06-05Run "make autostyle."Nick Mathewson
2019-05-30Merge branch 'tor-github/pr/1054'David Goulet
2019-05-30Merge branch 'tor-github/pr/1049'David Goulet
2019-05-29Merge branch 'ticket30561_029' into ticket30561_035Nick Mathewson
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-28Trivial fix for a trivial warning with gcc 9.1.1Nick Mathewson
Fix on 4e3d144fb0940d8ee5a89427d471ea3656e8e122; bug not in any released Tor.
2019-05-23In coverage builds, use branch-free timeradd() and timersub()Nick Mathewson
The ordinary definitions of timeradd() and timersub() contain a branch. However, in coverage builds, this means that we get spurious complaints about partially covered basic blocks, in a way that makes our coverage determinism harder to check.
2019-05-23In coverage builds, avoid basic-block complexity in log_debugNick Mathewson
Ordinarily we skip calling log_fn(LOG_DEBUG,...) if debug logging is completely disabled. However, in coverage builds, this means that we get spurious complaints about partially covered basic blocks, in a way that makes our coverage determinism harder to check.
2019-05-07Merge branch 'tor-github/pr/994'David Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2019-05-03Merge branch 'tor-github/pr/954'David Goulet
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-30Replace all remaining tor_mem_is_zero() with fast_mem_is_zero()Nick Mathewson
2019-04-30Use safe_mem_is_zero in a few more places.Nick Mathewson
I don't believe any of these represent a real timing vulnerability (remote timing against memcmp() on a modern CPU is not easy), but these are the ones where I believe we should be more careful.
2019-04-30Rename tor_mem_is_zero to fast_mem_is_zero()Nick Mathewson
For memeq and friends, "tor_" indicates constant-time and "fast_" indicates optimized. I'm fine with leaving the constant-time "safe_mem_is_zero" with its current name, but the "tor_" prefix on the current optimized version is misleading. Also, make the tor_digest*_is_zero() uniformly constant-time, and add a fast_digest*_is_zero() version to use as needed. A later commit in this branch will fix all the users of tor_mem_is_zero(). Closes ticket 30309.