tls/device: Use splice_eof() to flush
authorDavid Howells <dhowells@redhat.com>
Wed, 7 Jun 2023 18:19:12 +0000 (19:19 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 9 Jun 2023 02:40:30 +0000 (19:40 -0700)
commitd4c1e80b0d1bacbbca5184f122b9893c5920c598
tree7c43ae2ca0148883ac725b16e372d5a8486070bf
parentdf720d288dbb1793e82b6ccbfc670ec871e9def4
tls/device: Use splice_eof() to flush

Allow splice to end a TLS record after prematurely ending a splice/sendfile
due to getting an EOF condition (->splice_read() returned 0) after splice
had called TLS with a sendmsg() with MSG_MORE set when the user didn't set
MSG_MORE.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Link: https://lore.kernel.org/r/CAHk-=wh=V579PDYvkpnTobCLGczbgxpMgGmmhqiTyE34Cpi5Gg@mail.gmail.com/
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
cc: Chuck Lever <chuck.lever@oracle.com>
cc: Boris Pismenny <borisp@nvidia.com>
cc: John Fastabend <john.fastabend@gmail.com>
cc: Jens Axboe <axboe@kernel.dk>
cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls.h
net/tls/tls_device.c
net/tls/tls_main.c