Commit Graph

1009 Commits

Author SHA1 Message Date
teor 9c73f5adc4 Run "make autostyle" 2020-03-17 18:19:04 +10:00
David Goulet 05aab3fd21 Merge branch 'maint-0.4.3' 2020-03-10 09:14:44 -04:00
rl1987 f89c32ccd0 Document poll_interval_tv in procmon.c 2020-03-10 09:13:22 -04:00
David Goulet 2d53168511 Merge branch 'tor-github/pr/1723' 2020-03-09 10:36:05 -04:00
Nick Mathewson 7177eeddf1 Merge branch 'maint-0.4.3' 2020-03-05 08:48:40 -05:00
Nick Mathewson 686494f0f7 Merge branch 'clang_format_prep_3' 2020-03-05 08:23:32 -05:00
Nick Mathewson 2c792d1e0e In typed_var_kvassign, include config names in error messages.
This should improve the usability of our configuration error messages.
2020-02-26 14:18:40 -05:00
Nick Mathewson 7e7aff9b6a confmgt: when a units value is invalid, include a meaningful error.
Part of 33460.
2020-02-26 13:03:10 -05:00
Nick Mathewson b133325a3e confmgt: when an int/enum value is invalid, say which values are ok.
Part of 33460.
2020-02-26 13:02:28 -05:00
Nick Mathewson d4d5d9d1d1 Merge branch 'ticket33316_squashed' 2020-02-24 07:49:45 -05:00
Nick Mathewson e067cb426a Move process subsystem after evloop.
Process uses evloop, and so should be initialized after it.
2020-02-24 07:49:39 -05:00
Nick Mathewson 90524de0b2 Move winprocess_sys into a new low-level hardening module
This code was in our process module, but it doesn't belong there:
process is for launching and monitoring subprocesses, not for
hardening the current process.

This change lets us have our subsystem init order more closely match
our dependency order.
2020-02-24 07:49:39 -05:00
Nick Mathewson caa392a73a Merge remote-tracking branch 'tor-github/pr/1685/head' 2020-02-24 07:45:20 -05:00
Nick Mathewson 691d271b2e Re-order thread initialization to follow logging, and remove a comment.
lib/log no longer uses lib/thread; lib/log only uses lib/lock, which
is at a lower level.
2020-02-13 12:55:05 -05:00
Nick Mathewson 67d59d7d1f Re-order most subsystems to correspond to dependency order. 2020-02-13 12:53:15 -05:00
teor e849881d3a Run "make autostyle"
But only take the changes that were caused by the rest of the 33087
branch.

Part of 33087.
2020-02-13 09:28:21 +10:00
Nick Mathewson e231d84dd5 Merge branch 'maint-0.4.3' 2020-02-12 18:26:08 -05:00
Nick Mathewson d0c3350218 Run "make autostyle". 2020-02-12 18:25:51 -05:00
teor 8a23393eda log: Stop duplicating error file fds
Since we're not closing these fds, they don't need to be duplicated
any more.

Cleanup after 33087.
2020-02-13 00:01:47 +10:00
teor 3d1ef3b6f8 err/log: Stop closing stderr and stdout during shutdown
Closing these file descriptors can hide sanitiser logs.

Instead, flush the logs before tor exits, using fsync().
Some Windows environments don't have fsync(), so we check
for it at compile time.

Fixes bug 33087; bugfix on 0.4.1.6.
2020-02-13 00:00:41 +10:00
Nick Mathewson 384a771fcc Merge branch 'ticket32362_squashed' 2020-02-11 08:47:19 -05:00
Neel Chauhan 777d90fa23 Check for leading zeros in tor_inet_aton() 2020-02-11 08:47:13 -05:00
George Kadianakis 901ed35709 Make n_subcredentials a size_t .
Based on David's review.
2020-02-11 02:13:40 +02:00
Nick Mathewson d9e211ab70 Use semicolons after HT_PROTOTYPE and HT_GENERATE. 2020-02-10 12:54:43 -05:00
Nick Mathewson fbc1eaa0af Try to shorten an #error in address.c 2020-02-06 17:21:34 -05:00
Nick Mathewson 8a5a1600cd Extract verbatim table in uname.c 2020-02-06 17:06:12 -05:00
Nick Mathewson 7036ed3471 Fix a couple more long warning lines
These are not a problem with 2-space indentation, but cocci will
start getting confused when clang-format wraps them with 4-space
indentation.
2020-02-06 16:25:56 -05:00
Nick Mathewson 99a5aecbc7 Wrap columnar tables in "clang-format off/on"
These tables have aligned comments, so we don't want clang-format to
mess with them.
2020-02-06 14:54:04 -05:00
Nick Mathewson 06a6130666 Use parentheses to avoid mis-indentations of stringified macro args
clang-format sometimes thinks that "#name" should be written as
"#     name" if it appears at the start of a line.  Using () appears
to suppress this, while confusing Coccinelle.
2020-02-06 14:54:04 -05:00
Nick Mathewson 6104c407e0 maps: do not include _ as part of expected prefix in macros.
Doing this makes our macro usage a little clear IMO, and also avoids
having to use an unadorned "new" within a macro.  (Clang-format
seems to think that "new" means we're doing C++, and so it generates
some output that checkSpace.pl doesn't care for.)
2020-02-06 14:54:04 -05:00
Nick Mathewson 87b71a692a Remove senseless CHECK_PRINTF()s from util_bug.c
These belong in util_bug.h (and they already are there).

Their presence made clang-format misindent these functions in a way
that checkSpace.pl dislikes.
2020-02-06 14:54:04 -05:00
Nick Mathewson 60f01da78e Use smaller CPP error messages
Clang-format wants to split these messages across multiple lines,
which confuses the heck out of coccinelle.
2020-02-06 14:54:04 -05:00
Nick Mathewson 9feeb4cf97 prob_distr: use "clang-format off" to avoid wide lines for URLs 2020-02-06 14:33:05 -05:00
teor ff52051754 address: Fix comments in address.h
And improve inline function spacing, and function declaration
spacing.

Comment-only change.
2020-02-04 14:36:04 +10:00
David Goulet a1dec44723 Merge branch 'tor-github/pr/1697' 2020-01-30 13:48:36 -05:00
Nick Mathewson af76b9dcc6 Merge branch 'bug32673_035' 2020-01-30 09:58:23 -05:00
Nick Mathewson 9ea0c0bfcd Merge branch 'bug33093_logging_035' 2020-01-30 09:55:40 -05:00
Nick Mathewson 2a1f8ea2e7 Do not set "once" when calling tor_bug_occurred_ from BUG().
The "once" flag makes tor_bug_occurred_() say that future instances
of the warning will be suppressed -- but that's not something that
BUG() does.  Fixes bug 33095; bugfix on 0.4.1.1-alpha.
2020-01-30 09:43:34 -05:00
teor 6b392c333a Merge branch 'maint-0.4.0' into maint-0.4.1 2020-01-30 07:55:05 +10:00
teor 65825018c7 Merge branch 'maint-0.3.5' into maint-0.4.0 2020-01-30 07:54:58 +10:00
teor 41d52e9cd8 Merge remote-tracking branch 'tor-github/pr/1614' into maint-0.3.5 2020-01-30 07:53:53 +10:00
Nick Mathewson 2985a6018f buf_read_from_tls: Return ERROR_MISC, not WANTWRITE, on BUG().
Fixes bug 32673; bugfix on 0.3.0.4-alpha.  We introduced these
checks in ee5471f9aa to help diagnose 21369, but we used "-1"
when "TOR_TLS_ERROR_MISC" would have been correct.  Found by opara.

I don't think that this is actually getting triggered in the wild,
but if it were, it could cause nasty behavior: spurious
WANTREAD/WANTWRITE returns have a way of turning into CPU-eating
busy-loops.
2020-01-29 08:50:03 -05:00
Nick Mathewson 1f163fcbde Change BUG() messages in buf_flush_to_tls() to IF_BUG_ONCE()
We introduced these BUG() checks in b0ddaac074 to prevent a
recurrence of bug 23690.  But there's a report of the BUG() message
getting triggered and filling up the disk.  Let's change it to
IF_BUG_ONCE().

Fixes bug 33093; bugfix on 0.3.2.2-alpha.
2020-01-29 08:31:22 -05:00
Nick Mathewson 4269ab97c6 Add a function to maybe memcpy() a value, in constant time. 2020-01-21 10:31:36 -05:00
teor fb541ffca3 Merge branch 'maint-0.4.0' into maint-0.4.1 2020-01-16 10:00:40 +10:00
teor 026f068bb3 Merge branch 'maint-0.3.5' into maint-0.4.0 2020-01-16 10:00:32 +10:00
teor 19954cffd7 Merge remote-tracking branch 'tor-github/pr/1513' into maint-0.3.5 2020-01-16 09:57:27 +10:00
Nick Mathewson 5e27caa60c compat_compiler: add a macro to prevent coverity deadcode warnings.
The POSSIBLE(e) macro evaluates to the value of (e), but does so in
a way that a static analyzer will not conclude that (e) is
impossible.  We can use this when we expect our regular compilers to
eliminate deadcode, but we don't want coverity to complain about it.

Part of a fix for 32960.
2020-01-15 10:21:18 -05:00
Nick Mathewson c948db4252 Merge remote-tracking branch 'tor-github/pr/1636' 2020-01-14 12:46:14 -05:00
Nick Mathewson e45810113b Merge branch 'pre_formatter_cleanups_squashed' 2020-01-09 07:32:39 -05:00