lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun,  6 Oct 2019 20:53:22 -0700
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     netdev@...r.kernel.org, davem@...emloft.net, edumazet@...gle.com,
        willemb@...gle.com
Cc:     oss-drivers@...ronome.com, davejwatson@...com, borisp@...lanox.com,
        aviadye@...lanox.com, john.fastabend@...il.com,
        daniel@...earbox.net,
        Jakub Kicinski <jakub.kicinski@...ronome.com>,
        Simon Horman <simon.horman@...ronome.com>
Subject: [RFC 1/2] net/tls: don't clear socket error if strparser aborted

If strparser encounters an error it reports it on the socket and
stops any further processing. TLS RX will currently pick up that
error code with sock_error(), and report it to user space once.
Subsequent read calls will block indefinitely.

Since the error condition is not cleared and processing is not
restarted it seems more correct to keep returning the error
rather than sleeping.

Signed-off-by: Jakub Kicinski <jakub.kicinski@...ronome.com>
Reviewed-by: Simon Horman <simon.horman@...ronome.com>
---
 net/tls/tls_sw.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index de7561d4cfa5..a9ca2dbe0531 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1245,8 +1245,11 @@ static struct sk_buff *tls_wait_data(struct sock *sk, struct sk_psock *psock,
 	DEFINE_WAIT_FUNC(wait, woken_wake_function);
 
 	while (!(skb = ctx->recv_pkt) && sk_psock_queue_empty(psock)) {
-		if (sk->sk_err) {
-			*err = sock_error(sk);
+		if (unlikely(sk->sk_err)) {
+			if (ctx->strp.stopped)
+				*err = -sk->sk_err;
+			else
+				*err = sock_error(sk);
 			return NULL;
 		}
 
-- 
2.21.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ