[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 07:17:10 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):

 You're right. This is a bug in meek-client-torbrowser.

 Better than unsetting `TOR_PT_EXIT_ON_STDIN_CLOSE`, I think, is to
 actually give the meek-client subprocess a stdin, something like this:
 {{{
 #!diff
 @@ -268,6 +268,7 @@ func runMeekClient(helperAddr string,
 meekClientCommandLine []string) (cmd *exec
         args := meekClientCommandLine[1:]
         args = append(args, []string{"--helper", helperAddr}...)
         cmd = exec.Command(meekClientPath, args...)
 +       cmd.Stdin = os.Stdin
         cmd.Stdout = os.Stdout
         cmd.Stderr = os.Stderr
         log.Printf("running meek-client command %q", cmd.Args)
 }}}
 Another (possibly better) option is to call `cmd.StdinPipe()` and just
 never close the pipe (that way the child process's stdin is separate from
 the parent's, so you don't have a race between them trying to terminate
 when the stdin is closed).

 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:
 https://gitweb.torproject.org/tor.git/tree/src/or/transports.c?id=9e8b762fcecfece64aae70ae640aaa59fd227ca5#n1387

 What do you need from me, a new tag with this bug fixed?

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


More information about the tor-bugs mailing list