Source-Changes-HG archive

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

[src/trunk]: src/sys/opencrypto opencrypto: Assert !cpu_intr_p() on dispatch ...



details:   https://anonhg.NetBSD.org/src/rev/f4a87fc910c3
branches:  trunk
changeset: 366241:f4a87fc910c3
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Thu May 19 20:51:59 2022 +0000

description:
opencrypto: Assert !cpu_intr_p() on dispatch and invoke.

These should only ever have been potentially called from hard
interrupt context by CRYPTO_F_CBIMM callbacks (CBIMM = call back
immediately).  CRYPTO_F_CBIMM is no more, so there is no more need to
allow this case of call from hard interrupt context.

diffstat:

 sys/opencrypto/crypto.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r 30586b901acf -r f4a87fc910c3 sys/opencrypto/crypto.c
--- a/sys/opencrypto/crypto.c   Thu May 19 20:51:46 2022 +0000
+++ b/sys/opencrypto/crypto.c   Thu May 19 20:51:59 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: crypto.c,v 1.118 2022/05/19 20:51:46 riastradh Exp $ */
+/*     $NetBSD: crypto.c,v 1.119 2022/05/19 20:51:59 riastradh Exp $ */
 /*     $FreeBSD: src/sys/opencrypto/crypto.c,v 1.4.2.5 2003/02/26 00:14:05 sam Exp $   */
 /*     $OpenBSD: crypto.c,v 1.41 2002/07/17 23:52:38 art Exp $ */
 
@@ -53,7 +53,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.118 2022/05/19 20:51:46 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: crypto.c,v 1.119 2022/05/19 20:51:59 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/reboot.h>
@@ -1264,6 +1264,7 @@
        struct crypto_crp_q *crp_q;
 
        KASSERT(crp != NULL);
+       KASSERT(!cpu_intr_p());
 
        DPRINTF("crp %p, alg %d\n", crp, crp->crp_desc->crd_alg);
 
@@ -1373,6 +1374,7 @@
        struct crypto_crp_kq *crp_kq;
 
        KASSERT(krp != NULL);
+       KASSERT(!cpu_intr_p());
 
        cryptostats.cs_kops++;
 
@@ -1439,6 +1441,7 @@
        int error;
 
        KASSERT(krp != NULL);
+       KASSERT(!cpu_intr_p());
 
        /* Sanity checks. */
        if (krp->krp_callback == NULL) {
@@ -1524,6 +1527,7 @@
        struct cryptocap *cap;
 
        KASSERT(crp != NULL);
+       KASSERT(!cpu_intr_p());
 
 #ifdef CRYPTO_TIMING
        if (crypto_timing)



Home | Main Index | Thread Index | Old Index