[tor-bugs] #24642 [Obfuscation/meek]: cannot use TOR_PT_EXIT_ON_STDIN_CLOSE with meek-client-torbrowser

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Jan 10 17:55:42 UTC 2018


#24642: cannot use TOR_PT_EXIT_ON_STDIN_CLOSE with meek-client-torbrowser
------------------------------+---------------------
 Reporter:  mcs               |          Owner:  dcf
     Type:  defect            |         Status:  new
 Priority:  Medium            |      Milestone:
Component:  Obfuscation/meek  |        Version:
 Severity:  Normal            |     Resolution:
 Keywords:                    |  Actual Points:
Parent ID:  #24689            |         Points:
 Reviewer:                    |        Sponsor:
------------------------------+---------------------

Comment (by dcf):

 Replying to [comment:4 yawning]:
 > Replying to [comment:2 dcf]:
 > > I was pretty surprised by this, because I was under the impression
 that tor always sets `TOR_PT_EXIT_ON_STDIN_CLOSE=1` nowadays, and
 therefore this code should never have worked in any released bundle. But
 it turns out it only sets the variable for server transports, not client
 transports, which is why this bug wasn't detected earlier:
 >
 > I don't remember why it only does that on servers.  Should it set the
 env var for clients as well?

 I had assumed that it was set for clients too. I can't think of a reason
 why it wouldn't be (except for this bug, of course).

 The purpose of the [[comment:21:ticket:15435|terminateprocess-buffer]]
 program, which we [https://gitweb.torproject.org/builders/tor-browser-
 build.git/tree/projects/tor-browser/Bundle-Data/PTConfigs/windows/torrc-
 defaults-appendix?id=66f424078b1971d393406165f79d050e78d574f2#n8 still
 use] on Windows, was to simulate support for `TOR_PT_EXIT_ON_STDIN_CLOSE`
 in tor clients that don't have it. In my reasoning three years ago I
 thought that `TOR_PT_EXIT_ON_STDIN_CLOSE` was coming for clients and that
 terminateprocess-buffer would not be necessary someday.

 But that brings up another question: terminateprocess-buffer
 [https://gitweb.torproject.org/pluggable-transports/meek.git/tree
 /terminateprocess-buffer/terminateprocess-buffer.go?h=0.28#n30 sets]
 `TOR_PT_EXIT_ON_STDIN_CLOSE=1` unconditionally (and also provides its
 child process with a stdin). So it seems that this bug should have arisen
 on Windows, with meek-client exiting immediately because it doesn't have a
 stdin.

 The documentation for `exec.Cmd` [https://golang.org/pkg/os/exec/#Cmd
 says]:
   If Stdin is nil, the process reads from the null device (os.DevNull).
 Where [https://golang.org/pkg/os/#pkg-constants os.DevNull] is NUL on
 Windows. So all I can think of is that NUL doesn't provide an immediate
 EOF like /dev/null does. Or maybe I am missing something else. I need to
 run some more tests.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/24642#comment:5>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list