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

Re: [tor-bugs] #29206 [Circumvention/Snowflake]: New design for client -- server protocol for Snowflake



#29206: New design for client -- server protocol for Snowflake
-----------------------------------------------+---------------------------
 Reporter:  cohosh                             |          Owner:  cohosh
     Type:  task                               |         Status:
                                               |  needs_review
 Priority:  Medium                             |      Milestone:
Component:  Circumvention/Snowflake            |        Version:
 Severity:  Normal                             |     Resolution:
 Keywords:  anti-censorship-roadmap-september  |  Actual Points:
Parent ID:                                     |         Points:  6
 Reviewer:  dcf                                |        Sponsor:
                                               |  Sponsor28-must
-----------------------------------------------+---------------------------

Comment (by dcf):

 Replying to [comment:27 cohosh]:
 > - We don't currently have unit tests that check the client and server
 integration and we should have them

 I ported my recent
 [https://github.com/net4people/bbs/issues/14#issuecomment-542898991 Turbo
 Tunnel prototype program] to `SnowflakeConn`. You'll have to check it; I
 may have gotten the API wrong. But perhaps it can help test in a
 controlled environment.

 attachment:reconnecting-snowflakeconn.zip

 I managed to get a few panics, trying different things.

 ----

 {{{
 server$ ./server 127.0.0.1:4000
 2019/10/17 21:14:11 error in handleConn: EOF
 panic: runtime error: invalid memory address or nil pointer dereference
 [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x4f8d24]

 goroutine 5 [running]:
 github.com/cohosh/snowflake/common/snowflake-
 proto.(*SnowflakeConn).Write(0xc0000ba000, 0xc0000307a8, 0xc, 0x20, 0xc,
 0x20, 0x0)
 $GOPATH/pkg/mod/github.com/cohosh/snowflake@v0.0.0-20191002223810-1707fcc12518/common
 /snowflake-proto/proto.go:337 +0x424
 main.handleConn.func1(0xc0000ba000)
         reconnecting-snowflakeconn/server/main.go:62 +0x87
 created by main.handleConn
         reconnecting-snowflakeconn/server/main.go:58 +0x207
 }}}

 {{{
 client$ ./client 127.0.0.1:4000
 2019/10/17 21:14:08 begin SnowflakeConn c0bd93336fcab1ef
 2019/10/17 21:14:08 begin TCP connection 127.0.0.1:52386 -> 127.0.0.1:4000
 abcd
 ABCD
 ^C
 client$ ./client 127.0.0.1:4000
 2019/10/17 21:14:15 begin SnowflakeConn e446789c28f69bbc
 2019/10/17 21:14:15 begin TCP connection 127.0.0.1:52388 -> 127.0.0.1:4000
 xyz
 XYZ
 2019/10/17 21:14:19 stdout <- conn finished: EOF
 }}}

 This looks like it's the `err`/`err2` confusion from comment:28.

 ----

 {{{
 lilbastard$ lilbastard -w 10 127.0.0.1:3000 127.0.0.1:4000
 }}}

 {{{
 $ ./server 127.0.0.1:4000
 2019/10/17 21:18:41 error in handleConn: EOF
 panic: runtime error: invalid memory address or nil pointer dereference
 [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x4f8d24]

 goroutine 5 [running]:
 github.com/cohosh/snowflake/common/snowflake-
 proto.(*SnowflakeConn).Write(0xc0000be000, 0xc00002ffa8, 0xc, 0x20, 0xc,
 0x20, 0x0)
 $GOPATH/pkg/mod/github.com/cohosh/snowflake@v0.0.0-20191002223810-1707fcc12518/common
 /snowflake-proto/proto.go:337 +0x424
 main.handleConn.func1(0xc0000be000)
         reconnecting-snowflakeconn/server/main.go:62 +0x87
 created by main.handleConn
         reconnecting-snowflakeconn/server/main.go:58 +0x207
 }}}

 {{{
 $ ./client 127.0.0.1:3000
 2019/10/17 21:18:31 begin SnowflakeConn f2a5d31f6afa8727
 2019/10/17 21:18:31 begin TCP connection 127.0.0.1:39108 -> 127.0.0.1:3000
 abcd
 ABCD
 efgh
 EFGH
 ijkl2019/10/17 21:18:41 stdout <- conn finished: EOF

 2019/10/17 21:18:51 Closing WebRTC connection, timed out waiting for ACK
 }}}

 This looks similar, except the server and client report an EOF first.

 ----

 {{{
 server$ ./server 127.0.0.1:4000
 }}}

 {{{
 client$ yes | ./client 127.0.0.1:4000
 2019/10/17 21:16:01 begin SnowflakeConn eb27f73167a77490
 2019/10/17 21:16:01 begin TCP connection 127.0.0.1:52392 -> 127.0.0.1:4000
 2019/10/17 21:16:11 Closing WebRTC connection, timed out waiting for ACK
 panic: runtime error: invalid memory address or nil pointer dereference
 [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x4f52c4]

 goroutine 6 [running]:
 github.com/cohosh/snowflake/common/snowflake-
 proto.(*SnowflakeConn).Write(0xc0000a4000, 0xc0000b8000, 0x8000, 0x8000,
 0x8000, 0x0, 0x0)
 $GOPATH/pkg/mod/github.com/cohosh/snowflake@v0.0.0-20191002223810-1707fcc12518/common
 /snowflake-proto/proto.go:337 +0x424
 github.com/cohosh/snowflake/common/snowflake-proto.Proxy(0x55edc0,
 0xc0000a4000, 0x55ef80, 0xc00000e010, 0x0, 0x0, 0x0)
 $GOPATH/pkg/mod/github.com/cohosh/snowflake@v0.0.0-20191002223810-1707fcc12518/common
 /snowflake-proto/proto.go:406 +0xf0
 main.run.func1(0xc000012380, 0xc0000a4000)
         reconnecting-snowflakeconn/client/main.go:37 +0x7d
 created by main.run
         reconnecting-snowflakeconn/client/main.go:35 +0x3e8
 }}}

 This panic is in the client rather than the server.

--
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/29206#comment:29>
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