summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2007-11-14 19:10:45 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2007-11-14 19:10:45 +0000
commitc4374f390044236f9fce909a375267a588e127d0 (patch)
tree4d798347bcb5484fdd4b99f09342daa2d8925ca3
parent5783666eecca3c630cd50c0f98e13369725a1cba (diff)
do not process requests linked to unused sessions. (crypto_freesession
might happen between enqueuing a crypto request and scheduling of the crypto thread); ok hshoexer
-rw-r--r--sys/arch/i386/i386/via.c6
-rw-r--r--sys/arch/i386/pci/glxsb.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/sys/arch/i386/i386/via.c b/sys/arch/i386/i386/via.c
index 8f9e494db22..06549205497 100644
--- a/sys/arch/i386/i386/via.c
+++ b/sys/arch/i386/i386/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.15 2007/09/18 22:02:18 djm Exp $ */
+/* $OpenBSD: via.c,v 1.16 2007/11/14 19:10:44 markus Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -471,6 +471,10 @@ viac3_crypto_process(struct cryptop *crp)
goto out;
}
ses = &sc->sc_sessions[sesn];
+ if (ses->ses_used == 0) {
+ err = EINVAL;
+ goto out;
+ }
for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
switch (crd->crd_alg) {
diff --git a/sys/arch/i386/pci/glxsb.c b/sys/arch/i386/pci/glxsb.c
index c8712262417..7ff39d1ab33 100644
--- a/sys/arch/i386/pci/glxsb.c
+++ b/sys/arch/i386/pci/glxsb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: glxsb.c,v 1.11 2007/09/18 22:02:18 djm Exp $ */
+/* $OpenBSD: glxsb.c,v 1.12 2007/11/14 19:10:44 markus Exp $ */
/*
* Copyright (c) 2006 Tom Cosgrove <tom@openbsd.org>
@@ -737,6 +737,10 @@ glxsb_crypto_process(struct cryptop *crp)
goto out;
}
ses = &sc->sc_sessions[sesn];
+ if (ses->ses_used == 0) {
+ err = EINVAL;
+ goto out;
+ }
for (crd = crp->crp_desc; crd; crd = crd->crd_next) {
switch (crd->crd_alg) {