From 4cde107f58152405509ef6d697ef46e93958fa59 Mon Sep 17 00:00:00 2001 From: "Thordur I. Bjornsson" Date: Thu, 8 Jul 2010 09:46:51 +0000 Subject: Revert part of previous. The splvm protection is needed after all, as we are walking the list of registered crypto drivers and doing that unprotected is unwise. Pointed out by kettenis@ --- sys/crypto/crypto.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'sys/crypto') diff --git a/sys/crypto/crypto.c b/sys/crypto/crypto.c index 48dbee25c84..e34936c5bc4 100644 --- a/sys/crypto/crypto.c +++ b/sys/crypto/crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.c,v 1.55 2010/07/08 08:12:48 thib Exp $ */ +/* $OpenBSD: crypto.c,v 1.56 2010/07/08 09:46:50 thib Exp $ */ /* * The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu) * @@ -52,6 +52,8 @@ crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int hard) if (crypto_drivers == NULL) return EINVAL; + s = splvm(); + /* * The algorithm we use here is pretty stupid; just use the * first driver that supports all the algorithms we need. Do @@ -146,10 +148,10 @@ crypto_newsession(u_int64_t *sid, struct cryptoini *cri, int hard) * XXX layer right about here. */ - if (hid == -1) + if (hid == -1) { + splx(s); return EINVAL; - - s = splvm(); + } /* Call the driver initialization routine. */ lid = hid; /* Pass the driver ID. */ -- cgit v1.2.3