You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
netstacklat: Add sanity checks for rcv_nxt and copied_seq
In addition to the out-of-order sequence number in the previous
commit, two more key members that are read from the tcp_sock (outside
of the socket lock) is rcv_nxt and copied_seq. Add sanity checks to
these two members that ensure that they are monotonically
increasing (in a u32 wrap-around space).
To enable this sanity check, track the last seen (sane) value for both
of them together with the other ooo-state in the socket storage
map. At each read, compare the recorded values from the last read with
their current values to determine if the current values are ahead of
the previously seen values or not. Unlike the ooo sequence number, do
not consider sequence 0 invalid for these checks. As they are direct
members of the tcp_sock their values should always be valid (although
possibly concurrently updated elsewhere), as long as the probe read
succeeds (and failure is directly detected from the return value of
bpf_core_read()).
Skip adding similar monotonic growth checks for rcv_wup field to avoid
also having to probe and update that value every time. For the rcv_wnd
field I am no aware of any simple validity checks than can be
performed.
Signed-off-by: Simon Sundberg <[email protected]>
0 commit comments