7c4d1f974f
crypto_op() waited to be set CRYPTO_F_DONE with crp->crp_cv. However, there is context switch chances between being set CRYPTO_F_DONE in crypto_done() and done cv_signal(crp->crp_cv) in cryptodev_cb(), that is, cryptodev_op() thread can run to cv_destroy(crp->crp_cv) before cryptoret() thread is waken up. As a result, cryptodev_cb() can call invalid(destroyed) cv_signal(crp->crp_cv). Furthermore, below two implementations cause other races. - waiting CRYPTO_F_DONE with crp->crp_cv - context witch chances between set CRYPTO_F_DONE and cv_signal(crp->crp_cv) So, use other flag(CRYPTO_F_DQRETQ) for cryptodev_op() and cryptodev_key(), and then call cv_signal(crp->crp_cv) immediately after set CRYPTO_F_DQRETQ. Tested concurrent over 20 processes with software and hardware drivers. |
||
---|---|---|
.. | ||
aesxcbcmac.c | ||
aesxcbcmac.h | ||
criov.c | ||
crypto.c | ||
cryptodev_internal.h | ||
cryptodev.c | ||
cryptodev.h | ||
cryptosoft_xform.c | ||
cryptosoft.c | ||
cryptosoft.h | ||
deflate.c | ||
deflate.h | ||
files.opencrypto | ||
gmac.c | ||
gmac.h | ||
Makefile | ||
ocryptodev.c | ||
ocryptodev.h | ||
xform.c | ||
xform.h |