Page MenuHomeFreeBSD

tcp md5: improve handling of tcps_sig_err_sigopt counter
ClosedPublic

Authored by tuexen on Fri, Aug 28, 3:48 PM.
Tags
None
Referenced Files
F170842610: D59249.id185349.diff
Sun, Sep 6, 11:50 PM
F170829038: D59249.id185349.diff
Sun, Sep 6, 9:33 PM
F170787160: D59249.id.diff
Sun, Sep 6, 3:22 PM
F170741372: D59249.diff
Sun, Sep 6, 8:45 AM
Unknown Object (File)
Sun, Sep 6, 3:00 AM
Unknown Object (File)
Sat, Sep 5, 6:41 PM
Unknown Object (File)
Sat, Sep 5, 6:40 PM
Unknown Object (File)
Sat, Sep 5, 2:39 PM

Details

Summary

For non listening TCP endpoints, increment the tcps_sig_err_sigopt counter when TCP MD5 is not enabled in the TCP connection, but a segment containing a TCP MD5 option is received.
Also increment the counter when using the RACK or BBR stack.

Reported by: Hannes Elfert

Test Plan

Run the packetdrill script

--ip_version=ipv4
--tolerance_usecs=50000
--tcp_md5_secret=secret

// Ensure that all relevant sysctl variables have their default variables.
 0.000 `sysctl -w net.inet.tcp.rfc1323=1`
+0.000 `sysctl -w net.inet.tcp.sack.enable=1`
+0.000 `sysctl -w kern.ipc.maxsockbuf=2097152`
// Flush host cache.
+0.000 `sysctl -w net.inet.tcp.hostcache.purgenow=1`
// Create a TCP endpoint in the ESTABLISHED state.
+0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.000 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0
+0.000 connect(3, ..., ...) = -1 EINPROGRESS (Operation in progress)
+0.000 > S    0:0(0)             win 65535 <mss 1460,nop,wscale 6,sackOK,TS val 1000 ecr 0>
+0.050 < S.   0:0(0)     ack   1 win 65535 <mss 1460,sackOK,md5 valid>
+0.000 >  .   1:1(0)     ack   1 win 65535
+0.100 < P.   1:101(100) ack   1 win 65535 <nop,nop,md5 valid>
+0.000 recv(3, ..., 1000, 0) = 100
+0.040 >  .   1:1(0)     ack 101 win 65535
+0.100 < F. 101:101(0)   ack   1 win 65535 <nop,nop,md5 valid>
+0.000 >  .   1:1(0)     ack 102 win 65535
+0.000 recv(3, ..., 1000, 0) = 0
+0.000 close(3) = 0
+0.000 > F.   1:1(0)     ack 102 win 65535
+0.050 <  . 102:102(0)   ack   2 win 65535 <nop,nop,md5 valid>

and check using netstat -sptcp that the tcps_sig_err_sigopt counter was incremented by 4.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped