Message ID | 20190529233323.26602-1-jakub.kicinski@netronome.com |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
Series | [net] net: don't clear sock->sk early to avoid trouble in strparser | expand |
From: Jakub Kicinski <jakub.kicinski@netronome.com> Date: Wed, 29 May 2019 16:33:23 -0700 > af_inet sets sock->sk to NULL which trips strparser over: ... > To avoid this issue set sock->sk after sk_prot->close. > My grepping and testing did not discover any code which > would depend on the current behaviour. > > Fixes: c46234ebb4d1 ("tls: RX path for ktls") > Reported-by: David Beckett <david.beckett@netronome.com> > Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> > Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> > --- > We probably want to hold off on stable with this one :) Ok, applied. Will hold off on -stable :) I only worry about sk visibility after whatever close does.
diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c index 5183a2daba64..aff93e7cdb31 100644 --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -428,8 +428,8 @@ int inet_release(struct socket *sock) if (sock_flag(sk, SOCK_LINGER) && !(current->flags & PF_EXITING)) timeout = sk->sk_lingertime; - sock->sk = NULL; sk->sk_prot->close(sk, timeout); + sock->sk = NULL; } return 0; }