tls: rx: strp: don't use GFP_KERNEL in softirq context
authorJakub Kicinski <kuba@kernel.org>
Wed, 17 May 2023 01:50:42 +0000 (18:50 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Jun 2023 08:34:29 +0000 (10:34 +0200)
commitb026755cc9a8920cc07ceca7d91c0597ba554a1e
tree86bd50851f677a21db6bf18f2a8738871441948c
parenta2961463d74f5c86a8dda3b41c484c28ccc4c289
tls: rx: strp: don't use GFP_KERNEL in softirq context

commit 74836ec828fe17b63f2006fdbf53311d691396bf upstream.

When receive buffer is small, or the TCP rx queue looks too
complicated to bother using it directly - we allocate a new
skb and copy data into it.

We already use sk->sk_allocation... but nothing actually
sets it to GFP_ATOMIC on the ->sk_data_ready() path.

Users of HW offload are far more likely to experience problems
due to scheduling while atomic. "Copy mode" is very rarely
triggered with SW crypto.

Fixes: 84c61fe1a75b ("tls: rx: do not use the standard strparser")
Tested-by: Shai Amiram <samiram@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tls/tls_sw.c