Source-Changes-HG archive

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

[src/trunk]: src/sys/opencrypto don't always panic when modunload crypto (int...



details:   https://anonhg.NetBSD.org/src/rev/a550683ed391
branches:  trunk
changeset: 842023:a550683ed391
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Jun 13 02:02:45 2019 +0000

description:
don't always panic when modunload crypto (int the pool destroy code, because
the pools are busy). XXX: this is still racy; we need to prevent creating
more sessions while destroying.

diffstat:

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

diffs (27 lines):

diff -r 9860177db188 -r a550683ed391 sys/opencrypto/cryptodev.c
--- a/sys/opencrypto/cryptodev.c        Thu Jun 13 01:13:12 2019 +0000
+++ b/sys/opencrypto/cryptodev.c        Thu Jun 13 02:02:45 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cryptodev.c,v 1.100 2019/03/01 11:06:57 pgoyette Exp $ */
+/*     $NetBSD: cryptodev.c,v 1.101 2019/06/13 02:02:45 christos 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.100 2019/03/01 11:06:57 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cryptodev.c,v 1.101 2019/06/13 02:02:45 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -2246,6 +2246,8 @@
                return error;
        case MODULE_CMD_FINI:
 #ifdef _MODULE
+               if (crypto_refcount != 0)
+                       return EBUSY;
                error = config_cfdata_detach(crypto_cfdata);
                if (error) {
                        return error;



Home | Main Index | Thread Index | Old Index