net/tls: avoid NULL pointer deref on nskb->sk in fallback
authorJakub Kicinski <jakub.kicinski@netronome.com>
Mon, 29 Apr 2019 19:19:12 +0000 (12:19 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 May 2019 12:42:38 +0000 (14:42 +0200)
commita976384b955370e148c462e43f1a13400e33c24a
treeb1c19a792729324a2478ecaa946d61c18fb55af1
parent1d412d873a12f5d7aa1d8ef1792f330a5e0a27c2
net/tls: avoid NULL pointer deref on nskb->sk in fallback

[ Upstream commit 2dcb003314032c6efb13a065ffae60d164b2dd35 ]

update_chksum() accesses nskb->sk before it has been set
by complete_skb(), move the init up.

Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tls/tls_device_fallback.c