]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: tls: Save iv in tls_rec for async crypto requests
authorDave Watson <davejwatson@fb.com>
Sun, 27 Jan 2019 00:57:38 +0000 (00:57 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Feb 2019 16:27:38 +0000 (17:27 +0100)
commitcb77e08da85fba41c646795d1865df2fdff59a90
tree055903ccdc15db61bc9602829db385265aeeb69a
parent2c293753e4e7f6d82fdd565d18484189c1fe7f50
net: tls: Save iv in tls_rec for async crypto requests

[ Upstream commit 32eb67b93c9e3cd62cb423e30b090cdd4aa8d275 ]

aead_request_set_crypt takes an iv pointer, and we change the iv
soon after setting it.  Some async crypto algorithms don't save the iv,
so we need to save it in the tls_rec for async requests.

Found by hardcoding x64 aesni to use async crypto manager (to test the async
codepath), however I don't think this combination can happen in the wild.
Presumably other hardware offloads will need this fix, but there have been
no user reports.

Fixes: a42055e8d2c30 ("Add support for async encryption of records...")
Signed-off-by: Dave Watson <davejwatson@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/net/tls.h
net/tls/tls_sw.c