tls: rx: decrypt into a fresh skb
authorJakub Kicinski <kuba@kernel.org>
Fri, 15 Jul 2022 05:22:35 +0000 (22:22 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Jul 2022 10:24:11 +0000 (11:24 +0100)
commitfd31f3996af2627106e22a9f8072764fede51161
tree9f364a6ce7ecb7b5b94daba90002b6cfee8dc4c8
parentcbbdee9918a2662914f411aa999f2f80bf044a30
tls: rx: decrypt into a fresh skb

We currently CoW Rx skbs whenever we can't decrypt to a user
space buffer. The skbs can be enormous (64kB) and CoW does
a linear alloc which has a strong chance of failing under
memory pressure. Or even without, skb_cow_data() assumes
GFP_ATOMIC.

Allocate a new frag'd skb and decrypt into it. We finally
take advantage of the decrypted skb getting returned via
darg.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls.h
net/tls/tls_sw.c