[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180713222230.17949-1-vakul.garg@nxp.com>
Date: Sat, 14 Jul 2018 03:52:28 +0530
From: Vakul Garg <vakul.garg@....com>
To: netdev@...r.kernel.org
Cc: borisp@...lanox.com, davejwatson@...com, aviadye@...lanox.com,
davem@...emloft.net, Vakul Garg <vakul.garg@....com>
Subject: [PATCH net-next 1/3] net/tls: Do not enable zero-copy prematurely
Zero-copy mode was left enabled even when zerocopy_from_iter() failed.
Set the zero-copy mode only when zerocopy_from_iter() succeeds.
Signed-off-by: Vakul Garg <vakul.garg@....com>
---
net/tls/tls_sw.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 7453f5ae0819..d31dc2487488 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -800,7 +800,6 @@ int tls_sw_recvmsg(struct sock *sk,
struct scatterlist sgin[MAX_SKB_FRAGS + 1];
int pages = 0;
- zc = true;
sg_init_table(sgin, MAX_SKB_FRAGS + 1);
sg_set_buf(&sgin[0], ctx->rx_aad_plaintext,
TLS_AAD_SPACE_SIZE);
@@ -811,6 +810,8 @@ int tls_sw_recvmsg(struct sock *sk,
MAX_SKB_FRAGS, false);
if (err < 0)
goto fallback_to_reg_recv;
+ else
+ zc = true;
err = decrypt_skb(sk, skb, sgin);
for (; pages > 0; pages--)
--
2.13.6
Powered by blists - more mailing lists