Source-Changes-HG archive

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

[src/trunk]: src/sys/opencrypto crypto(4): Don't signal the condvar for multi...



details:   https://anonhg.NetBSD.org/src/rev/dc5190e95dc2
branches:  trunk
changeset: 366287:dc5190e95dc2
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat May 21 20:37:18 2022 +0000

description:
crypto(4): Don't signal the condvar for multi-operation completion.

The condvar may be destroyed by the time we got here, and nothing
waits on it anyway -- instead the caller is expected to select/poll
for completion in userland.

The bug was already here, but the recent change to eliminate
CRYPTO_F_CBIMM made it happen more often by causing the callback to
_always_ be run asynchronously instead of sometimes being run
synchronously.

diffstat:

 sys/opencrypto/cryptodev.c |  7 ++-----
 1 files changed, 2 insertions(+), 5 deletions(-)

diffs (28 lines):

diff -r 7c2d534461cb -r dc5190e95dc2 sys/opencrypto/cryptodev.c
--- a/sys/opencrypto/cryptodev.c        Sat May 21 19:57:06 2022 +0000
+++ b/sys/opencrypto/cryptodev.c        Sat May 21 20:37:18 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cryptodev.c,v 1.113 2022/05/19 20:51:46 riastradh Exp $ */
+/*     $NetBSD: cryptodev.c,v 1.114 2022/05/21 20:37:18 riastradh Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/cryptodev.c,v 1.4.2.4 2003/06/03 00:09:02 sam Exp $        */
 /*     $OpenBSD: cryptodev.c,v 1.53 2002/07/10 22:21:30 mickey Exp $   */
 
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.113 2022/05/19 20:51:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.114 2022/05/21 20:37:18 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -746,9 +746,6 @@
                error = crypto_dispatch(crp);
                mutex_enter(&cryptodev_mtx);
        }
-       if (error != 0 || (crp->crp_flags & CRYPTO_F_DONE)) {
-               cv_signal(&crp->crp_cv);
-       }
 
        TAILQ_INSERT_TAIL(&crp->fcrp->crp_ret_mq, crp, crp_next);
        selnotify(&crp->fcrp->sinfo, 0, 0);



Home | Main Index | Thread Index | Old Index