[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [tor-bugs] #10047 [Pluggable transport]: PTs could self-shutdown when they detect their stdout is closed



#10047: PTs could self-shutdown when they detect their stdout is closed
-------------------------------------+-------------------------------
     Reporter:  infinity0            |      Owner:  asn
         Type:  enhancement          |     Status:  new
     Priority:  normal               |  Milestone:
    Component:  Pluggable transport  |    Version:
   Resolution:                       |   Keywords:  needs-spec-change
Actual Points:                       |  Parent ID:  #10629
       Points:                       |
-------------------------------------+-------------------------------

Comment (by dcf):

 I found that you can make this idea work without any changes to tor. All
 you have to do is introduce a process that interposes between tor and the
 pluggable transport, and write the pluggable transport so that it
 interprets a closed stdin as a command to terminate. tor calls
 TerminateProcess on the buffer process, which dies immediately. The death
 of the buffer process closes the stdin of the pluggable transport.

 Here's a short implementation of the idea.
  * https://gitweb.torproject.org/pluggable-
 transports/meek.git/blob/5eeb8439d64c36971da3717b4163c8220f74a164
 :/processterminate-buffer/main.go
 The processterminate-buffer program is what gets called by tor.
 processterminate-buffer just executes the command given by its arguments
 and creates a pipe to the subcommand's stdin. The way it looks
 [https://gitweb.torproject.org/user/dcf/tor-browser-
 bundle.git/blob/861e270c648439a02189604bdb6ef68e994b1f16:/Bundle-
 Data/beta/windows/torrc-defaults-appendix#l39 in torrc] is:
 {{{
 ClientTransportPlugin meek exec ./Tor/PluggableTransports
 /processterminate-buffer ./Tor/PluggableTransports/meek-client-torbrowser
 --url=https://meek-reflect.appspot.com/ --front=www.google.com --log meek-
 client.log
 }}}
 That is, you just stick "processterminate-buffer" in front of the command
 line you were using before.

 I tested it in the [https://gitweb.torproject.org/user/dcf/tor-browser-
 bundle.git/tag/refs/tags/tbb-3.5.2.1-meek-5 tbb-3.5.2.1-meek-5] bundles,
 where the process tree looks like
 {{{
 tor
   processterminate-buffer
     meek-client-torbrowser
       firefox
       meek-client
 }}}
 When tor kill processterminate-buffer, meek-client-torbrowser notices and
 cleans up its own children.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/10047#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online
_______________________________________________
tor-bugs mailing list
tor-bugs@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-bugs