]> git.baikalelectronics.ru Git - kernel.git/commit
tls: Stricter error checking in zerocopy sendmsg path
authorDave Watson <davejwatson@fb.com>
Thu, 12 Jul 2018 15:03:43 +0000 (08:03 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Jul 2018 20:31:31 +0000 (13:31 -0700)
commitd7623f867cf6eabd55130ad2aedba653a6a61936
tree5a46f10804c8bcc68822d9100a1bc951218d8775
parenta0e805bdff4ad8602e5c42a6d0729ed3f4142c95
tls: Stricter error checking in zerocopy sendmsg path

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
17e0ef3d8f3 ("tls: fix waitall behavior in tls_sw_recvmsg"),
so we fail for all error codes.

Reported-by: syzbot+c226690f7b3126c5ee04@syzkaller.appspotmail.com
Reported-by: syzbot+709f2810a6a05f11d4d3@syzkaller.appspotmail.com
Signed-off-by: Dave Watson <davejwatson@fb.com>
Fixes: 3a71956a2d9a ("tls: kernel TLS support")
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c