On Wed, 24 Apr 2019 12:21:03 -0700, John Fastabend wrote: > It is possible (via shutdown()) for TCP socks to go through TCP_CLOSE > state via tcp_disconnect() without calling into close callback. This > would allow a kTLS enabled socket to exist outside of ESTABLISHED > state which is not supported. > > Solve this the same way we solved the sock{map|hash} case by adding > an unhash hook to remove tear down the TLS state. > > In the process we also make the close hook more robust. We add a put > call into the close path, also in the unhash path, to remove the > reference to ulp data after free. Its no longer valid and may confuse > things later if the socket (re)enters kTLS code paths. Second we add > an 'if(ctx)' check to ensure the ctx is still valid and not released > from a previous unhash/close path. > > Fixes: d91c3e17f75f2 ("net/tls: Only attach to sockets in ESTABLISHED state") > Reported-by: Eric Dumazet <edumazet@xxxxxxxxxx> > Signed-off-by: John Fastabend <john.fastabend@xxxxxxxxx> Nice, I think we were running into this!