]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC 328453: Move per-operation data out of the csession structure.
authorjhb <jhb@FreeBSD.org>
Mon, 11 Mar 2019 22:17:53 +0000 (22:17 +0000)
committerjhb <jhb@FreeBSD.org>
Mon, 11 Mar 2019 22:17:53 +0000 (22:17 +0000)
commit0d9acfd7cebb32f11d5f8858f07798cab8824843
tree17b9d73a34a647d86428c4e9c4208d7536e6583c
parent5b30db8c4615a53f0b69e31e0b0154f830a7f08e
MFC 328453: Move per-operation data out of the csession structure.

Create a struct cryptop_data which contains state needed for a single
symmetric crypto operation and move that state out of the session. This
closes a race with the CRYPTO_F_DONE flag that can result in use after
free.

While here, remove the 'cse->error' member.  It was just a copy of
'crp->crp_etype' and cryptodev_op() and cryptodev_aead() checked both
'crp->crp_etype' and 'cse->error'.  Similarly, do not check for an
error from mtx_sleep() since it is not used with PCATCH or a timeout
so cannot fail with an error.

PR: 218597
Sponsored by: Chelsio Communications
sys/opencrypto/cryptodev.c