NetBSD/sys/opencrypto
darran d6a1889de6 Fix a race condition in opencrypto where the crypto request could be
completed by the crypto device, queued on the retq, but freed by the
ioctl lwp.  The problem manifests as various panics relating to the
condvar inside the request. The problem can occur whenever the crypto
device completes the request immediately and the ioctl skips the cv_wait().

The problem can be reproduced by enabling cryptosoft and running an openssl
speed test. E.g.
    sysctl -w kern.cryptodevallowsoft=-1
    openssl speed -engine cryptodev -evp des-ede3-cbc -multi 64

Add a macro for TAILQ_FOREACH_REVERSE_SAFE() to queue.h, since this
was missing and the opencrypto code removes requests from a list while
iterating with TAILQ_FOREACH_REVERSE().

Add missing cv_destroy() calls for the key request cleanup.

Reviewed by Thor Lancelot Simon.
2008-11-18 12:59:58 +00:00
..
Makefile
criov.c
crypto.c Fix a race condition in opencrypto where the crypto request could be 2008-11-18 12:59:58 +00:00
cryptodev.c Fix a race condition in opencrypto where the crypto request could be 2008-11-18 12:59:58 +00:00
cryptodev.h Fix a race condition in opencrypto where the crypto request could be 2008-11-18 12:59:58 +00:00
cryptosoft.c
cryptosoft.h
cryptosoft_xform.c
deflate.c
deflate.h
files.opencrypto
xform.c
xform.h