[tor-bugs] #28942 [Circumvention/Snowflake]: Evaluate pion WebRTC

Tor Bug Tracker & Wiki blackhole at torproject.org
Wed Jun 19 14:48:30 UTC 2019


#28942: Evaluate pion WebRTC
-------------------------------------+-------------------------------
 Reporter:  backkem                  |          Owner:  cohosh
     Type:  enhancement              |         Status:  assigned
 Priority:  Medium                   |      Milestone:
Component:  Circumvention/Snowflake  |        Version:
 Severity:  Normal                   |     Resolution:
 Keywords:  ex-sponsor-19            |  Actual Points:
Parent ID:                           |         Points:
 Reviewer:                           |        Sponsor:  Sponsor28-can
-------------------------------------+-------------------------------
Changes (by cohosh):

 * cc: backkem (added)


Comment:

 Found the issue. The reassembly queue is returning an `io.ErrShortBuffer`
 error. It seems the `dataChannelBufferSize` constant is too small for the
 data that the client is sending:
 [https://github.com/pion/webrtc/blob/master/datachannel.go#L16
 datachannel.go#L16]

 The reassembly queue works by concatenating all of the fragments for a
 SCTP Stream Sequence Number (SSN) and trying to read them into the
 provided buffer all at once. If the buffer is too short, an
 io.ErrShortBuffer is returned from `reassemblyQueue.read`
 [https://github.com/pion/sctp/blob/master/reassembly_queue.go#L285 here],
 but the function calling it (`Stream.ReadSCTP`) doesn't return an error
 and the data for that sequence number is simply lost
 [https://github.com/pion/sctp/blob/master/stream.go#L98 here]. Not that in
 particular the error returned from the reassemblyQueue read is being
 overwritten.


 There's a few bugs here:
 1. If the buffer is too small, we should split up the reads into multiple
 subsequent reads.
 2. The error for the reassembly queue should be checked.

 I can write up a patch for this, now that I have a good handle of what's
 going on.

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


More information about the tor-bugs mailing list