summaryrefslogtreecommitdiffstats
path: root/net/tls/tls_strp.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-07-15 07:22:33 +0200
committerDavid S. Miller <davem@davemloft.net>2022-07-18 12:24:11 +0200
commitc618db2afe7c31d13ca8cf05b60f17165fbdc282 (patch)
treeaa66b80b665d2a52d9149377e2df3de0dfd8d6f1 /net/tls/tls_strp.c
parenttls: rx: async: adjust record geometry immediately (diff)
downloadlinux-c618db2afe7c31d13ca8cf05b60f17165fbdc282.tar.xz
linux-c618db2afe7c31d13ca8cf05b60f17165fbdc282.zip
tls: rx: async: hold onto the input skb
Async crypto currently benefits from the fact that we decrypt in place. When we allow input and output to be different skbs we will have to hang onto the input while we move to the next record. Clone the inputs and keep them on a list. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls/tls_strp.c')
-rw-r--r--net/tls/tls_strp.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/net/tls/tls_strp.c b/net/tls/tls_strp.c
new file mode 100644
index 000000000000..9ccab79a6e1e
--- /dev/null
+++ b/net/tls/tls_strp.c
@@ -0,0 +1,17 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/skbuff.h>
+
+#include "tls.h"
+
+int tls_strp_msg_hold(struct sock *sk, struct sk_buff *skb,
+ struct sk_buff_head *dst)
+{
+ struct sk_buff *clone;
+
+ clone = skb_clone(skb, sk->sk_allocation);
+ if (!clone)
+ return -ENOMEM;
+ __skb_queue_tail(dst, clone);
+ return 0;
+}