summaryrefslogtreecommitdiff
path: root/net/tls
diff options
context:
space:
mode:
authorJakub Kicinski <jakub.kicinski@netronome.com>2019-05-21 19:02:01 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-04 08:02:33 +0200
commitfb69403ec2ff56bc587873b88a55812fce39d617 (patch)
tree3c3d7f001cbab29b724cbdd66d06857a8e529ab9 /net/tls
parent27d8ad1d8ea9b9c80ae13556c34927ad83a4355d (diff)
downloadlinux-rpi3-fb69403ec2ff56bc587873b88a55812fce39d617.tar.gz
linux-rpi3-fb69403ec2ff56bc587873b88a55812fce39d617.tar.bz2
linux-rpi3-fb69403ec2ff56bc587873b88a55812fce39d617.zip
net/tls: fix state removal with feature flags off
[ Upstream commit 3686637e507b48525fcea6fb91e1988bdbc14530 ] TLS offload drivers shouldn't (and currently don't) block the TLS offload feature changes based on whether there are active offloaded connections or not. This seems to be a good idea, because we want the admin to be able to disable the TLS offload at any time, and there is no clean way of disabling it for active connections (TX side is quite problematic). So if features are cleared existing connections will stay offloaded until they close, and new connections will not attempt offload to a given device. However, the offload state removal handling is currently broken if feature flags get cleared while there are active TLS offloads. RX side will completely bail from cleanup, even on normal remove path, leaving device state dangling, potentially causing issues when the 5-tuple is reused. It will also fail to release the netdev reference. Remove the RX-side warning message, in next release cycle it should be printed when features are disabled, rather than when connection dies, but for that we need a more efficient method of finding connection of a given netdev (a'la BPF offload code). Fixes: 4799ac81e52a ("tls: Add rx inline crypto offload") Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_device.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
index fdf22cb0b3e6..5db330db77a1 100644
--- a/net/tls/tls_device.c
+++ b/net/tls/tls_device.c
@@ -916,12 +916,6 @@ void tls_device_offload_cleanup_rx(struct sock *sk)
if (!netdev)
goto out;
- if (!(netdev->features & NETIF_F_HW_TLS_RX)) {
- pr_err_ratelimited("%s: device is missing NETIF_F_HW_TLS_RX cap\n",
- __func__);
- goto out;
- }
-
netdev->tlsdev_ops->tls_dev_del(netdev, tls_ctx,
TLS_OFFLOAD_CTX_DIR_RX);