* [PATCH net] net: tls: prevent false connection termination with offload
@ 2019-03-28 21:54 Jakub Kicinski
2019-03-28 22:01 ` Jakub Kicinski
2019-03-29 20:39 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2019-03-28 21:54 UTC (permalink / raw)
To: davem
Cc: netdev, oss-drivers, borisp, davejwatson, vakul.garg,
Jakub Kicinski, Simon Horman
Only decrypt_internal() performs zero copy on rx, all paths
which don't hit decrypt_internal() must set zc to false,
otherwise tls_sw_recvmsg() may return 0 causing the application
to believe that that connection got closed.
Currently this happens with device offload when new record
is first read from.
Fixes: d069b780e367 ("tls: Fix tls_device receive")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
---
net/tls/tls_sw.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 4f821edeeae6..4741edf4bb1e 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1497,6 +1497,8 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb,
return err;
}
+ } else {
+ *zc = false;
}
rxm->full_len -= padding_length(ctx, tls_ctx, skb);
--
2.21.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: tls: prevent false connection termination with offload
2019-03-28 21:54 [PATCH net] net: tls: prevent false connection termination with offload Jakub Kicinski
@ 2019-03-28 22:01 ` Jakub Kicinski
2019-03-29 20:39 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2019-03-28 22:01 UTC (permalink / raw)
To: davem; +Cc: netdev, oss-drivers, borisp, davejwatson, vakul.garg,
Simon Horman
On Thu, 28 Mar 2019 14:54:43 -0700, Jakub Kicinski wrote:
> Only decrypt_internal() performs zero copy on rx, all paths
> which don't hit decrypt_internal() must set zc to false,
> otherwise tls_sw_recvmsg() may return 0 causing the application
> to believe that that connection got closed.
>
> Currently this happens with device offload when new record
> is first read from.
>
> Fixes: d069b780e367 ("tls: Fix tls_device receive")
Reported-by: David Beckett <david.beckett@netronome.com>
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Simon Horman <simon.horman@netronome.com>
> ---
> net/tls/tls_sw.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
> index 4f821edeeae6..4741edf4bb1e 100644
> --- a/net/tls/tls_sw.c
> +++ b/net/tls/tls_sw.c
> @@ -1497,6 +1497,8 @@ static int decrypt_skb_update(struct sock *sk, struct sk_buff *skb,
>
> return err;
> }
> + } else {
> + *zc = false;
> }
>
> rxm->full_len -= padding_length(ctx, tls_ctx, skb);
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: tls: prevent false connection termination with offload
2019-03-28 21:54 [PATCH net] net: tls: prevent false connection termination with offload Jakub Kicinski
2019-03-28 22:01 ` Jakub Kicinski
@ 2019-03-29 20:39 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-03-29 20:39 UTC (permalink / raw)
To: jakub.kicinski
Cc: netdev, oss-drivers, borisp, davejwatson, vakul.garg,
simon.horman
From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Thu, 28 Mar 2019 14:54:43 -0700
> Only decrypt_internal() performs zero copy on rx, all paths
> which don't hit decrypt_internal() must set zc to false,
> otherwise tls_sw_recvmsg() may return 0 causing the application
> to believe that that connection got closed.
>
> Currently this happens with device offload when new record
> is first read from.
>
> Fixes: d069b780e367 ("tls: Fix tls_device receive")
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Simon Horman <simon.horman@netronome.com>
Applied, thanks Jakub.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-01 17:13 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-28 21:54 [PATCH net] net: tls: prevent false connection termination with offload Jakub Kicinski
2019-03-28 22:01 ` Jakub Kicinski
2019-03-29 20:39 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).