commit a83650852d3cd00c9916cae74d755ae55a6b506d
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Wed Feb 14 10:45:57 2018 -0500
Add another NULL-pointer fix for protover.c.
This one can only be exploited if you can generate a correctly
signed consensus, so it's not as bad as 25074.
Fixes bug 25251; also tracked as TROVE-2018-004.
---
changes/trove-2018-004 | 8 ++++++++
src/or/protover.c | 5 +++++
2 files changed, 13 insertions(+)
diff --git a/…
[View More]changes/trove-2018-004 b/changes/trove-2018-004
new file mode 100644
index 000000000..37e0a89b0
--- /dev/null
+++ b/changes/trove-2018-004
@@ -0,0 +1,8 @@
+ o Minor bugfixes (denial-of-service):
+ - Fix a possible crash on malformed consensus. If a consensus had
+ contained an unparseable protocol line, it could have made clients
+ and relays crash with a null-pointer exception. To exploit this
+ issue, however, an attacker would need to be able to subvert the
+ directory-authority system. Fixes bug 25251; bugfix on
+ 0.2.9.4-alpha. Also tracked as TROVE-2018-004.
+
diff --git a/src/or/protover.c b/src/or/protover.c
index a75077462..e63036f78 100644
--- a/src/or/protover.c
+++ b/src/or/protover.c
@@ -624,6 +624,11 @@ protover_all_supported(const char *s, char **missing_out)
}
smartlist_t *entries = parse_protocol_list(s);
+ if (BUG(entries == NULL)) {
+ log_warn(LD_NET, "Received an unparseable protocol list %s"
+ " from the consensus", escaped(s));
+ return 1;
+ }
missing = smartlist_new();
[View Less]
commit 65f2eec694f18a64291cc85317b9f22dacc1d8e4
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Thu Feb 1 16:33:52 2018 -0500
Correctly handle NULL returns from parse_protocol_list when voting.
In some cases we had checked for it, but in others we had not. One
of these cases could have been used to remotely cause
denial-of-service against directory authorities while they attempted
to vote.
Fixes TROVE-2018-001.
---
changes/trove-2018-001.1 | 6 +…
[View More]+++++
src/or/protover.c | 6 ++++++
2 files changed, 12 insertions(+)
diff --git a/changes/trove-2018-001.1 b/changes/trove-2018-001.1
new file mode 100644
index 000000000..f0ee92f40
--- /dev/null
+++ b/changes/trove-2018-001.1
@@ -0,0 +1,6 @@
+ o Major bugfixes (denial-of-service, directory authority):
+ - Fix a protocol-list handling bug that could be used to remotely crash
+ directory authorities with a null-pointer exception. Fixes bug 25074;
+ bugfix on 0.2.9.4-alpha. Also tracked as TROVE-2018-001.
+
+
diff --git a/src/or/protover.c b/src/or/protover.c
index 98957cabd..a75077462 100644
--- a/src/or/protover.c
+++ b/src/or/protover.c
@@ -554,6 +554,12 @@ protover_compute_vote(const smartlist_t *list_of_proto_strings,
// First, parse the inputs and break them into singleton entries.
SMARTLIST_FOREACH_BEGIN(list_of_proto_strings, const char *, vote) {
smartlist_t *unexpanded = parse_protocol_list(vote);
+ if (! unexpanded) {
+ log_warn(LD_NET, "I failed with parsing a protocol list from "
+ "an authority. The offending string was: %s",
+ escaped(vote));
+ continue;
+ }
smartlist_t *this_vote = expand_protocol_list(unexpanded);
if (this_vote == NULL) {
log_warn(LD_NET, "When expanding a protocol list from an authority, I "
[View Less]
commit 1fe0bae508120bbf4954de6b590dd0c722a883bc
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Thu Feb 15 09:05:55 2018 -0500
Forbid UINT32_MAX as a protocol version
The C code and the rust code had different separate integer overflow
bugs here. That suggests that we're better off just forbidding this
pathological case.
Also, add tests for expected behavior on receiving a bad protocol
list in a consensus.
Fixes another part of 25249.
--…
[View More]-
changes/bug25249.2 | 3 +++
src/or/protover.c | 8 ++++++--
src/test/test_protover.c | 21 ++++++++++++++++++---
3 files changed, 27 insertions(+), 5 deletions(-)
diff --git a/changes/bug25249.2 b/changes/bug25249.2
new file mode 100644
index 000000000..9058c1107
--- /dev/null
+++ b/changes/bug25249.2
@@ -0,0 +1,3 @@
+ o Minor bugfixes (spec conformance):
+ - Forbid UINT32_MAX as a protocol version. Fixes part of bug 25249;
+ bugfix on 0.2.9.4-alpha.
diff --git a/src/or/protover.c b/src/or/protover.c
index f32316f8e..a035b5c83 100644
--- a/src/or/protover.c
+++ b/src/or/protover.c
@@ -103,6 +103,9 @@ proto_entry_free(proto_entry_t *entry)
tor_free(entry);
}
+/** The largest possible protocol version. */
+#define MAX_PROTOCOL_VERSION (UINT32_MAX-1)
+
/**
* Given a string <b>s</b> and optional end-of-string pointer
* <b>end_of_range</b>, parse the protocol range and store it in
@@ -130,7 +133,7 @@ parse_version_range(const char *s, const char *end_of_range,
/* Note that this wouldn't be safe if we didn't know that eventually,
* we'd hit a NUL */
- low = (uint32_t) tor_parse_ulong(s, 10, 0, UINT32_MAX, &ok, &next);
+ low = (uint32_t) tor_parse_ulong(s, 10, 0, MAX_PROTOCOL_VERSION, &ok, &next);
if (!ok)
goto error;
if (next > end_of_range)
@@ -148,7 +151,8 @@ parse_version_range(const char *s, const char *end_of_range,
if (!TOR_ISDIGIT(*s)) {
goto error;
}
- high = (uint32_t) tor_parse_ulong(s, 10, 0, UINT32_MAX, &ok, &next);
+ high = (uint32_t) tor_parse_ulong(s, 10, 0,
+ MAX_PROTOCOL_VERSION, &ok, &next);
if (!ok)
goto error;
if (next != end_of_range)
diff --git a/src/test/test_protover.c b/src/test/test_protover.c
index 4c41b6db6..8d061c69c 100644
--- a/src/test/test_protover.c
+++ b/src/test/test_protover.c
@@ -257,12 +257,27 @@ test_protover_all_supported(void *arg)
tt_str_op(msg, OP_EQ, "Sleen=0-2147483648");
tor_free(msg);
- /* Rust seems to experience an internal error here */
- tt_assert(! protover_all_supported("Sleen=0-4294967295", &msg));
- tt_str_op(msg, OP_EQ, "Sleen=0-4294967295");
+ /* This case is allowed. */
+ tt_assert(! protover_all_supported("Sleen=0-4294967294", &msg));
+ tt_str_op(msg, OP_EQ, "Sleen=0-4294967294");
tor_free(msg);
+ /* If we get an unparseable list, we say "yes, that's supported." */
+ tor_capture_bugs_(1);
+ tt_assert(protover_all_supported("Fribble", &msg));
+ tt_ptr_op(msg, OP_EQ, NULL);
+ tor_end_capture_bugs_();
+
+ /* This case is forbidden. Since it came from a protover_all_supported,
+ * it can trigger a bug message. */
+ tor_capture_bugs_(1);
+ tt_assert(protover_all_supported("Sleen=0-4294967295", &msg));
+ tt_ptr_op(msg, OP_EQ, NULL);
+ tor_free(msg);
+ tor_end_capture_bugs_();
+
done:
+ tor_end_capture_bugs_();
tor_free(msg);
}
[View Less]
commit d4a64fbf5aaba383638d9f3c70bd2951f8c5ad89
Author: Roger Dingledine <arma(a)torproject.org>
Date: Sat Mar 3 01:56:49 2018 -0500
specify when OwningControllerFD option went in
---
control-spec.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/control-spec.txt b/control-spec.txt
index c1110bc..03d153d 100644
--- a/control-spec.txt
+++ b/control-spec.txt
@@ -3299,7 +3299,7 @@
__OwningControllerFD
If this option is a valid socket, Tor will start …
[View More]with an open control
- connection on this socket. Added in Tor 0.3.3.xxxx.
+ connection on this socket. Added in Tor 0.3.3.1-alpha.
This socket will be an owning controller, as if it had already called
TAKEOWNERSHIP. It will be automatically authenticated. This option
[View Less]
commit 79e61857d55331571c9b7d6540145940955ee16b
Author: Roger Dingledine <arma(a)torproject.org>
Date: Sat Mar 3 01:49:53 2018 -0500
remove caesura in proposal name
we can be poetic in other epochs
---
proposals/250-commit-reveal-consensus.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/proposals/250-commit-reveal-consensus.txt b/proposals/250-commit-reveal-consensus.txt
index 1190fd6..c9711aa 100644
--- a/proposals/250-commit-reveal-consensus.txt
…
[View More]+++ b/proposals/250-commit-reveal-consensus.txt
@@ -1,5 +1,5 @@
Filename: 250-commit-reveal-consensus.txt
-Title: Random Number Generation During Tor Voting
+Title: Random Number Generation During Tor Voting
Authors: David Goulet, George Kadianakis
Created: 2015-08-03
Status: Closed
[View Less]
commit ba05c9a935a96a4d8e94be1f3db768808b738b1c
Author: Roger Dingledine <arma(a)torproject.org>
Date: Sat Mar 3 01:48:33 2018 -0500
fix typos in proposal 290
---
proposals/290-deprecate-consensus-methods.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/proposals/290-deprecate-consensus-methods.txt b/proposals/290-deprecate-consensus-methods.txt
index db047c8..54e900c 100644
--- a/proposals/290-deprecate-consensus-methods.txt
+++ b/proposals/290-…
[View More]deprecate-consensus-methods.txt
@@ -21,7 +21,7 @@ Status: Open
With proposal 215, we deprecated and removed support for all
consensus methods before method 13. That was good as far as it went,
but it didn't solve the problem going forward: the latest consensus
- methods is now 28.
+ method is now 28.
This proposal describes a policy for removing older consensus methods
going forward, so we won't have to keep supporting them forever.
@@ -32,7 +32,7 @@ Status: Open
deprecated.
Specifically, I propose that we deprecate all methods older than the
- highest method supported in first stable release of the oldest LTS
+ highest method supported in the first stable release of the oldest LTS
(long-term support) release series.
For example, the current oldest LTS series is 0.2.5.x. The first
@@ -57,7 +57,7 @@ Status: Open
previous implementations of the feature.
Some consensus methods remove a feature that was used up to method
- N. Deprecating method M means that the feature is no longer used by
+ M. Deprecating method M means that the feature is no longer used by
any supported consensus methods. Therefore, we can remove any code
that implements the feature.
[View Less]
commit 2bd23cebf36f97f36fc61ee818be1bfede27d6fd
Author: Roger Dingledine <arma(a)torproject.org>
Date: Fri Mar 2 19:21:45 2018 -0500
resolve a weird binary character that crept into the man page
---
doc/tor.1.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/tor.1.txt b/doc/tor.1.txt
index 59f4df79e..5f6186696 100644
--- a/doc/tor.1.txt
+++ b/doc/tor.1.txt
@@ -1894,7 +1894,7 @@ is non-zero):
If you want to use a reduced exit policy rather than the …
[View More]default exit
policy, set "ReducedExitPolicy 1". If you want to _replace_ the default
exit policy with your custom exit policy, end your exit policy with either
- a reject *:* or an accept *:*. Otherwise, you’re _augmenting_ (prepending
+ a reject *:* or an accept *:*. Otherwise, you're _augmenting_ (prepending
to) the default or reduced exit policy. +
+
The default exit policy is:
[View Less]