]> 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)
commit3d79b69e94b927715b74f8db66e8efd4895d6c9c
tree2915698ec3e6c25f67e7ed13c14ad6061f64188b
parent8e888f10ce83b505a11add2f9567b82c7a752b63
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: 88e71268d615 ("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