]> git.baikalelectronics.ru Git - kernel.git/commit
net/tls: Disable async decrytion for tls1.3
authorVakul Garg <vakul.garg@nxp.com>
Sat, 9 Feb 2019 07:53:28 +0000 (07:53 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 9 Feb 2019 17:27:49 +0000 (09:27 -0800)
commitbb0c138255b25dffaa2173f8c59cab468dfac365
tree665a121c5bcb7ef224816e9cc84142e94a49aa84
parentf52325d0f5d0e5f850f7ab2ea9d20c3195defaf0
net/tls: Disable async decrytion for tls1.3

Function tls_sw_recvmsg() dequeues multiple records from stream parser
and decrypts them. In case the decryption is done by async accelerator,
the records may get submitted for decryption while the previous ones may
not have been decryted yet. For tls1.3, the record type is known only
after decryption. Therefore, for tls1.3, tls_sw_recvmsg() may submit
records for decryption even if it gets 'handshake' records after 'data'
records. These intermediate 'handshake' records may do a key updation.
By the time new keys are given to ktls by userspace, it is possible that
ktls has already submitted some records i(which are encrypted with new
keys) for decryption using old keys. This would lead to decrypt failure.
Therefore, async decryption of records should be disabled for tls1.3.

Fixes: a1e61f9d1514f ("net: tls: Add tls 1.3 support")
Signed-off-by: Vakul Garg <vakul.garg@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c