Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys



Module Name:    src
Committed By:   darran
Date:           Tue Nov 18 12:59:58 UTC 2008

Modified Files:
        src/sys/opencrypto: crypto.c cryptodev.c cryptodev.h
        src/sys/sys: queue.h

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -r1.29 -r1.30 src/sys/opencrypto/crypto.c
cvs rdiff -r1.44 -r1.45 src/sys/opencrypto/cryptodev.c
cvs rdiff -r1.14 -r1.15 src/sys/opencrypto/cryptodev.h
cvs rdiff -r1.49 -r1.50 src/sys/sys/queue.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



Home | Main Index | Thread Index | Old Index