Commit Graph

33799 Commits

Author SHA1 Message Date
David Goulet
33414e5494 test: Add unit test for connection_dir_is_global_write_low()
Part of #33029

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11 10:15:04 -05:00
David Goulet
6d9113d2f6 dirauth: Resume sending 503 directory error code
Authorities were never sending back 503 error code because by design they
should be able to always answer directory requests regardless of bandwidth
capacity.

However, that recently backfired because of a large number of requests from
unknown source using the DirPort that are _not_ getting their 503 code which
overloaded the DirPort leading to the authority to be unable to answer to its
fellow authorities.

This is not a complete solution to the problem but it will help ease off the
load on the authority side by sending back 503 codes *unless* the connection
is from a known relay or an authority.

Fixes #33029

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11 09:58:28 -05:00
David Goulet
735aa208b1 dirauth: Add option AuthDirRejectRequestsUnderLoad
This controls the previous feature added that makes dirauth send back a 503
error code on non relay connections if under bandwidth pressure.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11 09:57:05 -05:00
David Goulet
bd4f4cb5f0 dirlist: Add configured trusted dir to the nodelist address set
The configured, within the torrc or hardcoded, directory authorities addresses
are now added to the nodelist address set.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11 09:35:54 -05:00
David Goulet
4152c349b4 nodelist: Helper to add an address to the nodelist address set
We separate v4 and v6 because we often use an IPv4 address represented with
a uint32_t instead of a tor_addr_t.

This will be used to also add the trusted directory addresses taken from the
configuration.

The trusted directories from the consensus are already added to the address
set from their descriptor.

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11 09:35:50 -05:00
David Goulet
872f95ca06 mainloop: Modernize a bit connection_dir_is_global_write_low()
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11 09:35:46 -05:00
David Goulet
c1e0ac63b8 mainloop: Remove unused parameter from connection_dir_is_global_write_low()
Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11 09:35:40 -05:00
David Goulet
ee55823a11 mainloop: Rename global_write_bucket_low()
That function is only used to test the global bucket write limit for a
directory connection.

It should _not_ be used for anything else since that function looks to see if
we are a directory authority.

Rename it to something more meaningful. No change in behavior at this commit,
only renaming.

Part of #33029

Signed-off-by: David Goulet <dgoulet@torproject.org>
2020-02-11 09:34:55 -05:00
Nick Mathewson
00fe214729 Merge branch 'maint-0.4.1' into maint-0.4.2
"ours" merge, since the exceptions.txt file is already fixed in this branch.
2020-02-11 08:53:00 -05:00
Nick Mathewson
0ff3e8f4a0 Remove a redundant practracker exception line in maint-0.4.1
This will our "git push" hook not complain about pushing from
maint-0.4.1.
2020-02-11 08:52:26 -05:00
Nick Mathewson
0c90fc37ec Merge branch 'maint-0.4.1' into maint-0.4.2 2020-02-10 14:17:10 -05:00
Nick Mathewson
71c49f7356 Merge branch 'maint-0.4.0' into maint-0.4.1 2020-02-10 14:17:10 -05:00
Nick Mathewson
f3fa22bf1b Merge branch 'maint-0.3.5' into maint-0.4.0 2020-02-10 14:17:09 -05:00
Nick Mathewson
2b6df3da21 Merge branch 'bug33212_035' into maint-0.3.5 2020-02-10 14:17:03 -05:00
Nick Mathewson
99d044d553 Fix a Rust compilation warning; resolve bug 33212. 2020-02-10 13:32:09 -05:00
Nick Mathewson
c5e610af05 Merge branch 'maint-0.4.1' into maint-0.4.2
Using "ours" strategy to avoid version bump
2020-01-30 11:19:23 -05:00
Nick Mathewson
49cffee635 bump to 0.4.2.6-dev 2020-01-30 11:19:16 -05:00
Nick Mathewson
7afb95d3e3 Bump to 0.4.1.8-dev 2020-01-30 11:18:50 -05:00
Nick Mathewson
f470b863a0 Bump version to 0.4.2.6 2020-01-29 19:44:29 -05:00
Nick Mathewson
0fb407591b Merge branch 'maint-0.4.1' into maint-0.4.2
"Ours" merge to avoid version bump.
2020-01-29 19:42:43 -05:00
Nick Mathewson
ec7f99e6ef bump to 0.4.1.8 2020-01-29 19:42:24 -05:00
teor
7b6be02a92
Merge branch 'maint-0.4.1' into maint-0.4.2 2020-01-30 07:55:12 +10: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
9b0b2aef80
Merge remote-tracking branch 'tor-github/pr/1634' into maint-0.4.1 2020-01-30 07:54:39 +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
teor
48187248d3
Merge branch 'maint-0.4.1' into maint-0.4.2 2020-01-16 10:00:47 +10: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
teor
7e111d0eaa
practracker: print a notice to stderr when disabled
When TOR_DISABLE_PRACTRACKER is set, print a message to
stderr when skipping practracker checks.

Part of 32705.
2020-01-14 17:41:00 +10:00
Nick Mathewson
6b1592b564 test_practracker.sh: never disable practracker
When practracker is disabled, its output will be empty.  We don't
want that happening during our tests.

Fixes bug 32705; bugfix on 0.4.2.1-alpha, when test_practracker.sh
was introduced.
2020-01-13 16:17:51 -05:00
Nick Mathewson
6da989cfe8 Merge remote-tracking branch 'tor-github/pr/1612' into maint-0.4.2 2020-01-06 13:20:57 -05:00
Nick Mathewson
54eec5342d Initialize publish/subscribe code when running as an NT service.
Fixes bug 32778; bugfix on 0.4.1.1-alpha.
2020-01-06 09:22:57 -05:00
Nick Mathewson
2d8d6d1ebf Merge branch 'maint-0.4.1' into maint-0.4.2 2020-01-06 08:08:59 -05:00
Nick Mathewson
f5461a4bdf update changes file to pass "make check-changes" 2020-01-06 08:08:48 -05:00
Nick Mathewson
16e94dc7a7 Merge branch 'maint-0.4.1' into maint-0.4.2 2020-01-06 08:06:54 -05:00
Peter Gerber
b9d81282e0 Fix sandbox crash during reload of logging configuration
Allow calls to dup() which was introduced in commit a22fbab986.

From a security perspective, I don't think this should impact the
security of the sandbox significantly. As far as I can tell, there
is nothing an adversary can do with a duplicated FD that can't be
done with the original.
2020-01-05 15:24:45 +00:00
teor
5dbb607e94
Merge branch 'maint-0.4.1' into maint-0.4.2 2019-12-20 10:12:51 +10:00
teor
7237637871
Merge branch 'maint-0.4.0' into maint-0.4.1 2019-12-20 10:12:43 +10:00
Peter Gerber
0d64bafcfe Correct how we use libseccomp
This fixes a startup crash with libseccomp v2.4.0 if Sandbox is
set to 1.
2019-12-17 09:47:28 -05:00
Nick Mathewson
b4977d1aa9 Fix formatting in tor_assertf() message in struct_check_magic().
Closes 32771; bugfix on 0.4.2.1-alpha.
2019-12-16 15:31:23 -05:00
Nick Mathewson
df5c81fec0 Merge branch 'bug32765_041' into bug32771_042 2019-12-16 15:27:18 -05:00
Nick Mathewson
1b619a627c Use CHECK_PRINTF() for printf-like functions in util_bug.h 2019-12-16 15:14:13 -05:00
teor
8b5c11fbf6
Merge branch 'bug32240_32242_041' into bug32240_32242_042 2019-12-16 09:23:46 +10:00
teor
84c4ede052
Merge branch 'bug32240_32242_040' into bug32240_32242_041 2019-12-16 09:23:41 +10:00
teor
d96b35d663
Merge branch 'bug32240_32242_035' into bug32240_32242_040
Merge:
* libzstd-dev from ticket32242_035
* shellcheck from maint-0.4.0
2019-12-16 09:22:52 +10:00
teor
0b3763612c
Merge remote-tracking branch 'tor-github/pr/1459' into bug32240_32242_035 2019-12-16 09:21:05 +10:00
teor
da404910a7
Merge branch 'bug32240_041' into bug32240_042
Merge:
* CHUTNEY_TOR_SANDBOX=0 from bug32240_041
* RUST_VERSION from maint-0.4.2
2019-12-16 09:15:42 +10:00
teor
4a34fd5b74
Merge branch 'bug32240_040' into bug32240_041 2019-12-16 09:14:38 +10:00