Browse Source

Merge branch 'tor-github/pr/1057'

David Goulet 5 years ago
parent
commit
8dfc8d7063
2 changed files with 8 additions and 1 deletions
  1. 6 0
      changes/bug30629
  2. 2 1
      src/app/main/shutdown.c

+ 6 - 0
changes/bug30629

@@ -0,0 +1,6 @@
+  o Minor bugfixes (shutdown, libevent, memory safety):
+    - Avoid use-after-free bugs when shutting down, by making sure that we
+      shut down libevent only after shutting down all of its users. We
+      believe these are harmless in practice, since they only occur on the
+      shutdown path, and do not involve any attacker-controlled data. Fixes
+      bug 30629; bugfix on 0.4.1.1-alpha.

+ 2 - 1
src/app/main/shutdown.c

@@ -157,10 +157,11 @@ tor_free_all(int postfork)
   if (!postfork) {
     release_lockfile();
   }
-  tor_libevent_free_all();
 
   subsystems_shutdown();
 
+  tor_libevent_free_all();
+
   /* Stuff in util.c and address.c*/
   if (!postfork) {
     esc_router_info(NULL);