All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] net/tls: fix async operation
@ 2020-01-10 12:38 Jakub Kicinski
  2020-01-10 19:22 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Kicinski @ 2020-01-10 12:38 UTC (permalink / raw)
  To: davem
  Cc: netdev, oss-drivers, borisp, aviadye, john.fastabend, daniel,
	Jakub Kicinski, Mallesham Jatharakonda, Simon Horman

Mallesham reports the TLS with async accelerator was broken by
commit d10523d0b3d7 ("net/tls: free the record on encryption error")
because encryption can return -EINPROGRESS in such setups, which
should not be treated as an error.

The error is also present in the BPF path (likely copied from there).

Reported-by: Mallesham Jatharakonda <mallesham.jatharakonda@oneconvergence.com>
Fixes: d3b18ad31f93 ("tls: add bpf support to sk_msg handling")
Fixes: d10523d0b3d7 ("net/tls: free the record on encryption error")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Simon Horman <simon.horman@netronome.com>
---
 net/tls/tls_sw.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index c6803a82b769..bb229dc0fa81 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -772,7 +772,7 @@ static int bpf_exec_tx_verdict(struct sk_msg *msg, struct sock *sk,
 	psock = sk_psock_get(sk);
 	if (!psock || !policy) {
 		err = tls_push_record(sk, flags, record_type);
-		if (err) {
+		if (err && err != -EINPROGRESS) {
 			*copied -= sk_msg_free(sk, msg);
 			tls_free_open_rec(sk);
 		}
@@ -801,7 +801,7 @@ static int bpf_exec_tx_verdict(struct sk_msg *msg, struct sock *sk,
 	switch (psock->eval) {
 	case __SK_PASS:
 		err = tls_push_record(sk, flags, record_type);
-		if (err < 0) {
+		if (err && err != -EINPROGRESS) {
 			*copied -= sk_msg_free(sk, msg);
 			tls_free_open_rec(sk);
 			goto out_err;
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net] net/tls: fix async operation
  2020-01-10 12:38 [PATCH net] net/tls: fix async operation Jakub Kicinski
@ 2020-01-10 19:22 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-01-10 19:22 UTC (permalink / raw)
  To: jakub.kicinski
  Cc: netdev, oss-drivers, borisp, aviadye, john.fastabend, daniel,
	mallesham.jatharakonda, simon.horman

From: Jakub Kicinski <jakub.kicinski@netronome.com>
Date: Fri, 10 Jan 2020 04:38:32 -0800

> Mallesham reports the TLS with async accelerator was broken by
> commit d10523d0b3d7 ("net/tls: free the record on encryption error")
> because encryption can return -EINPROGRESS in such setups, which
> should not be treated as an error.
> 
> The error is also present in the BPF path (likely copied from there).
> 
> Reported-by: Mallesham Jatharakonda <mallesham.jatharakonda@oneconvergence.com>
> Fixes: d3b18ad31f93 ("tls: add bpf support to sk_msg handling")
> Fixes: d10523d0b3d7 ("net/tls: free the record on encryption error")
> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
> Reviewed-by: Simon Horman <simon.horman@netronome.com>

Applied and queued up for -stable, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-01-10 19:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-10 12:38 [PATCH net] net/tls: fix async operation Jakub Kicinski
2020-01-10 19:22 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.