diff options
| author | Jakub Kicinski <[email protected]> | 2022-07-15 05:22:35 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2022-07-18 10:24:11 +0000 |
| commit | fd31f3996af2627106e22a9f8072764fede51161 (patch) | |
| tree | 9f364a6ce7ecb7b5b94daba90002b6cfee8dc4c8 /net/tls/tls.h | |
| parent | tls: rx: async: don't put async zc on the list (diff) | |
| download | kernel-fd31f3996af2627106e22a9f8072764fede51161.tar.gz kernel-fd31f3996af2627106e22a9f8072764fede51161.zip | |
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 <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/tls/tls.h')
| -rw-r--r-- | net/tls/tls.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/tls/tls.h b/net/tls/tls.h index c818dc68955d..3740740504e3 100644 --- a/net/tls/tls.h +++ b/net/tls/tls.h @@ -39,6 +39,9 @@ #include <linux/skmsg.h> #include <net/tls.h> +#define TLS_PAGE_ORDER (min_t(unsigned int, PAGE_ALLOC_COSTLY_ORDER, \ + TLS_MAX_PAYLOAD_SIZE >> PAGE_SHIFT)) + #define __TLS_INC_STATS(net, field) \ __SNMP_INC_STATS((net)->mib.tls_statistics, field) #define TLS_INC_STATS(net, field) \ |
