webrtc/net/dcsctp
Victor Boivie d579e6bc7b dcsctp: Do explicit bounds checking in bounded IO
The previous approach was that the caller was responsible for ensuring
that any buffer passed in to the Bounded IO wrappers, and that any
offset from where sub-readers were created were valid. The called would
always do a validation of the data and return proper error messages
if they were not.

This didn't pan out. https://crbug.com/1216758 found an overflow that
fooled the validation logic and the fuzzer could read out-of-bounds,
although it would always crash in that particular case.

There was already bounds checking, but under DCHECKs. This CL changes
that so that any bounds checking is done with CHECKS, as would've been
done in Rust. It's better to crash than to read arbitrary memory.

Bug: chromium:1216758
Change-Id: I89b52f0758495b5fe46f926c142870a263b96314
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/221743
Commit-Queue: Victor Boivie <boivie@webrtc.org>
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34303}
2021-06-16 13:02:32 +00:00
..
common dcsctp: Add missing target dependencies 2021-05-03 12:19:29 +00:00
fuzzers dcsctp: Add public API for BufferedAmountLow 2021-05-27 15:27:27 +00:00
packet dcsctp: Do explicit bounds checking in bounded IO 2021-06-16 13:02:32 +00:00
public dcsctp: Allow heartbeats to be disabled 2021-05-31 12:19:38 +00:00
rx dcsctp: Optimize SACK generation 2021-05-31 16:30:21 +00:00
socket dcsctp: Allow heartbeats to be disabled 2021-05-31 12:19:38 +00:00
testing Enable GN check on //net. 2021-05-03 14:23:09 +00:00
timer dcsctp: Handle starting timer from timer callback 2021-05-05 13:13:03 +00:00
tx dcsctp: Stay in stream if not producing fragment 2021-06-02 09:45:59 +00:00
BUILD.gn dcsctp: Add socket fuzzer helper 2021-05-12 15:06:17 +00:00
OWNERS dcsctp: Add OWNERS file 2021-04-20 10:42:58 +00:00