diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-06-04 12:00:12 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-04 13:34:37 -0700 |
commit | e52972c11d6b1262964db96d65934196db621685 (patch) | |
tree | b082376e72b7935d16315fa9e1e9620fc8bca38b /include/net | |
parent | 27393f8c6efc03b8e0b64134721b0d337fca0a80 (diff) | |
download | lwn-e52972c11d6b1262964db96d65934196db621685.tar.gz lwn-e52972c11d6b1262964db96d65934196db621685.zip |
net/tls: replace the sleeping lock around RX resync with a bit lock
Commit 38030d7cb779 ("net/tls: avoid NULL-deref on resync during device removal")
tried to fix a potential NULL-dereference by taking the
context rwsem. Unfortunately the RX resync may get called
from soft IRQ, so we can't use the rwsem to protect from
the device disappearing. Because we are guaranteed there
can be only one resync at a time (it's called from strparser)
use a bit to indicate resync is busy and make device
removal wait for the bit to get cleared.
Note that there is a leftover "flags" field in struct
tls_context already.
Fixes: 4799ac81e52a ("tls: Add rx inline crypto offload")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/tls.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/net/tls.h b/include/net/tls.h index 39ea62f0c1f6..4a55ce6a303f 100644 --- a/include/net/tls.h +++ b/include/net/tls.h @@ -209,6 +209,10 @@ struct tls_offload_context_tx { (ALIGN(sizeof(struct tls_offload_context_tx), sizeof(void *)) + \ TLS_DRIVER_STATE_SIZE) +enum tls_context_flags { + TLS_RX_SYNC_RUNNING = 0, +}; + struct cipher_context { char *iv; char *rec_seq; |