]> git.baikalelectronics.ru Git - kernel.git/commit
tls: Fix mixing between async capable and async
authorEran Ben Elisha <eranbe@mellanox.com>
Wed, 27 Feb 2019 15:38:05 +0000 (17:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Mar 2019 06:10:16 +0000 (22:10 -0800)
commit415105a4f7e4fc603de149ccd789a08f1232c071
tree2915698ec3e6c25f67e7ed13c14ad6061f64188b
parent8f7c928535f28ef6a8de5c821103219464e60207
tls: Fix mixing between async capable and async

Today, tls_sw_recvmsg is capable of using asynchronous mode to handle
application data TLS records. Moreover, it assumes that if the cipher
can be handled asynchronously, then all packets will be processed
asynchronously.

However, this assumption is not always true. Specifically, for AES-GCM
in TLS1.2, it causes data corruption, and breaks user applications.

This patch fixes this problem by separating the async capability from
the decryption operation result.

Fixes: 8f98058fe3d6 ("net/tls: Do not use async crypto for non-data records")
Signed-off-by: Eran Ben Elisha <eranbe@mellanox.com>
Reviewed-by: Boris Pismenny <borisp@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls_sw.c