net/tls: Fix kmap usage
authorIra Weiny <ira.weiny@intel.com>
Tue, 11 Aug 2020 00:02:58 +0000 (17:02 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:10 +0000 (08:24 +0200)
commit511406544bcbbc5b7f89ee4f033db549f9a0cc6a
treed469531a0efc2a16f3c52501fbc63856472cd66a
parentd822a1f1b756632336757b29fc1dafbd442b458a
net/tls: Fix kmap usage

[ Upstream commit b06c19d9f827f6743122795570bfc0c72db482b0 ]

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: e8f69799810c ("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>
net/tls/tls_device.c