]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.1.7/net-tls-fix-state-removal-with-feature-flags-off.patch
Linux 5.1.7
[thirdparty/kernel/stable-queue.git] / releases / 5.1.7 / net-tls-fix-state-removal-with-feature-flags-off.patch
CommitLineData
ffc20820
GKH
1From foo@baz Fri 31 May 2019 03:16:39 PM PDT
2From: Jakub Kicinski <jakub.kicinski@netronome.com>
3Date: Tue, 21 May 2019 19:02:01 -0700
4Subject: net/tls: fix state removal with feature flags off
5
6From: Jakub Kicinski <jakub.kicinski@netronome.com>
7
8[ Upstream commit 3686637e507b48525fcea6fb91e1988bdbc14530 ]
9
10TLS offload drivers shouldn't (and currently don't) block
11the TLS offload feature changes based on whether there are
12active offloaded connections or not.
13
14This seems to be a good idea, because we want the admin to
15be able to disable the TLS offload at any time, and there
16is no clean way of disabling it for active connections
17(TX side is quite problematic). So if features are cleared
18existing connections will stay offloaded until they close,
19and new connections will not attempt offload to a given
20device.
21
22However, the offload state removal handling is currently
23broken if feature flags get cleared while there are
24active TLS offloads.
25
26RX side will completely bail from cleanup, even on normal
27remove path, leaving device state dangling, potentially
28causing issues when the 5-tuple is reused. It will also
29fail to release the netdev reference.
30
31Remove the RX-side warning message, in next release cycle
32it should be printed when features are disabled, rather
33than when connection dies, but for that we need a more
34efficient method of finding connection of a given netdev
35(a'la BPF offload code).
36
37Fixes: 4799ac81e52a ("tls: Add rx inline crypto offload")
38Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
39Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
40Signed-off-by: David S. Miller <davem@davemloft.net>
41Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
42---
43 net/tls/tls_device.c | 6 ------
44 1 file changed, 6 deletions(-)
45
46--- a/net/tls/tls_device.c
47+++ b/net/tls/tls_device.c
cd010321 48@@ -943,12 +943,6 @@ void tls_device_offload_cleanup_rx(struc
ffc20820
GKH
49 if (!netdev)
50 goto out;
51
52- if (!(netdev->features & NETIF_F_HW_TLS_RX)) {
53- pr_err_ratelimited("%s: device is missing NETIF_F_HW_TLS_RX cap\n",
54- __func__);
55- goto out;
56- }
57-
58 netdev->tlsdev_ops->tls_dev_del(netdev, tls_ctx,
59 TLS_OFFLOAD_CTX_DIR_RX);
60