]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Correctly handle NULL returns from parse_protocol_list when voting.
authorNick Mathewson <nickm@torproject.org>
Thu, 1 Feb 2018 21:33:52 +0000 (16:33 -0500)
committerNick Mathewson <nickm@torproject.org>
Thu, 1 Mar 2018 21:05:17 +0000 (16:05 -0500)
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 [new file with mode: 0644]
src/or/protover.c

diff --git a/changes/trove-2018-001.1 b/changes/trove-2018-001.1
new file mode 100644 (file)
index 0000000..f0ee92f
--- /dev/null
@@ -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.
+
+
index 98957cabdf04870b593ba4d55c702f146e05501c..a750774623a5f2a50f0bd9b566416692b2b8d209 100644 (file)
@@ -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 "