Skip to content

Commit 5114065

Browse files
weiny2gregkh
authored andcommitted
net/tls: Fix kmap usage
[ Upstream commit b06c19d ] When MSG_OOB is specified to tls_device_sendpage() the mapped page is never unmapped. Hold off mapping the page until after the flags are checked and the page is actually needed. Fixes: e8f6979 ("net/tls: Add generic NIC offload infrastructure") Signed-off-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d822a1f commit 5114065

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎net/tls/tls_device.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,7 @@ int tls_device_sendpage(struct sock *sk, struct page *page,
561561
{
562562
struct tls_context *tls_ctx = tls_get_ctx(sk);
563563
struct iov_iter msg_iter;
564-
char *kaddr = kmap(page);
564+
char *kaddr;
565565
struct kvec iov;
566566
int rc;
567567

@@ -576,6 +576,7 @@ int tls_device_sendpage(struct sock *sk, struct page *page,
576576
goto out;
577577
}
578578

579+
kaddr = kmap(page);
579580
iov.iov_base = kaddr + offset;
580581
iov.iov_len = size;
581582
iov_iter_kvec(&msg_iter, WRITE, &iov, 1, size);

0 commit comments

Comments
 (0)