From a47c133c869db74024c9ab50801cd6b7553409e4 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 31 Jan 2017 14:12:14 -0500 Subject: [PATCH 1/2] Do not clear is_bad_exit on sybil. But do clear is_v2_dir. Fixes bug 21108 -- bugfix on d95e7c7d67134b9b964d49cf8c2bdbf805a in 0.2.0.13-alpha. --- changes/bug21108_029 | 6 ++++++ src/or/dirserv.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changes/bug21108_029 diff --git a/changes/bug21108_029 b/changes/bug21108_029 new file mode 100644 index 0000000000..3a3f004fc6 --- /dev/null +++ b/changes/bug21108_029 @@ -0,0 +1,6 @@ + o Major bugfixes (directory authority): + - During voting, when marking a node as a probable sybil, do not + clear its BadExit flag: sybils can still be bad in other ways + too. (We still clear the other flags.) Fixes bug 21108; bugfix + on 0.2.0.13-alpha. + diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 34db06355b..cbed64657a 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2239,7 +2239,7 @@ clear_status_flags_on_sybil(routerstatus_t *rs) { rs->is_authority = rs->is_exit = rs->is_stable = rs->is_fast = rs->is_flagged_running = rs->is_named = rs->is_valid = - rs->is_hs_dir = rs->is_possible_guard = rs->is_bad_exit = 0; + rs->is_hs_dir = rs->is_v2_dir = rs->is_possible_guard = 0; /* FFFF we might want some mechanism to check later on if we * missed zeroing any flags: it's easy to add a new flag but * forget to add it to this clause. */ From 6ff7850f2617a0e565c2fd13deb5aaebf39e974a Mon Sep 17 00:00:00 2001 From: Roger Dingledine Date: Tue, 31 Jan 2017 15:06:15 -0500 Subject: [PATCH 2/2] be explicit in clear_status_flags_on_sybil that we leave BadExit alone --- src/or/dirserv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/or/dirserv.c b/src/or/dirserv.c index cbed64657a..1b614b949e 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2233,6 +2233,10 @@ dirserv_set_routerstatus_testing(routerstatus_t *rs) /** Routerstatus rs is part of a group of routers that are on * too narrow an IP-space. Clear out its flags: we don't want people * using it. + * + * Leave its BadExit flag alone though, since if we think it's a bad exit, + * we want to vote that way in case all the other authorities are voting + * Running and Exit. */ static void clear_status_flags_on_sybil(routerstatus_t *rs)