[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180720121426.323488713@linuxfoundation.org>
Date: Fri, 20 Jul 2018 14:14:17 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-kernel@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
stable@...r.kernel.org,
syzbot+c226690f7b3126c5ee04@...kaller.appspotmail.com,
syzbot+709f2810a6a05f11d4d3@...kaller.appspotmail.com,
Dave Watson <davejwatson@...com>,
"David S. Miller" <davem@...emloft.net>
Subject: [PATCH 4.17 071/101] tls: Stricter error checking in zerocopy sendmsg path
4.17-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Watson <davejwatson@...com>
commit 32da12216e467dea70a09cd7094c30779ce0f9db upstream.
In the zerocopy sendmsg() path, there are error checks to revert
the zerocopy if we get any error code. syzkaller has discovered
that tls_push_record can return -ECONNRESET, which is fatal, and
happens after the point at which it is safe to revert the iter,
as we've already passed the memory to do_tcp_sendpages.
Previously this code could return -ENOMEM and we would want to
revert the iter, but AFAIK this no longer returns ENOMEM after
a447da7d004 ("tls: fix waitall behavior in tls_sw_recvmsg"),
so we fail for all error codes.
Reported-by: syzbot+c226690f7b3126c5ee04@...kaller.appspotmail.com
Reported-by: syzbot+709f2810a6a05f11d4d3@...kaller.appspotmail.com
Signed-off-by: Dave Watson <davejwatson@...com>
Fixes: 3c4d7559159b ("tls: kernel TLS support")
Signed-off-by: David S. Miller <davem@...emloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
---
net/tls/tls_sw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -440,7 +440,7 @@ alloc_encrypted:
ret = tls_push_record(sk, msg->msg_flags, record_type);
if (!ret)
continue;
- if (ret == -EAGAIN)
+ if (ret < 0)
goto send_end;
copied -= try_to_copy;
Powered by blists - more mailing lists