summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2012-01-13 09:53:25 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2012-01-13 09:53:25 +0000
commit5d33e89a6956aa9eba1522836d491556f72848b5 (patch)
tree5e050a3d5a3d4ed5e6844a3a0ad68c3bb4568817 /sys/arch/amd64
parentffe459cb7def60bf29c44f2c53b5c82ca24713e2 (diff)
handle m_copyback errors, this code is too sensitive for such
failures to be neglected; ok markus
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/via.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/via.c b/sys/arch/amd64/amd64/via.c
index 2dbc9305235..b6ac5c47522 100644
--- a/sys/arch/amd64/amd64/via.c
+++ b/sys/arch/amd64/amd64/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.11 2011/04/20 06:51:34 deraadt Exp $ */
+/* $OpenBSD: via.c,v 1.12 2012/01/13 09:53:24 mikeb Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -376,7 +376,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
if ((crd->crd_flags & CRD_F_IV_PRESENT) == 0) {
if (crp->crp_flags & CRYPTO_F_IMBUF)
- m_copyback((struct mbuf *)crp->crp_buf,
+ err = m_copyback((struct mbuf *)crp->crp_buf,
crd->crd_inject, 16, sc->op_iv, M_NOWAIT);
else if (crp->crp_flags & CRYPTO_F_IOV)
cuio_copyback((struct uio *)crp->crp_buf,
@@ -384,6 +384,8 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
else
bcopy(sc->op_iv,
crp->crp_buf + crd->crd_inject, 16);
+ if (err)
+ return (err);
}
} else {
sc->op_cw[0] = ses->ses_cw0 | C3_CRYPT_CWLO_DECRYPT;
@@ -417,7 +419,7 @@ viac3_crypto_encdec(struct cryptop *crp, struct cryptodesc *crd,
crd->crd_len / 16, sc->op_iv);
if (crp->crp_flags & CRYPTO_F_IMBUF)
- m_copyback((struct mbuf *)crp->crp_buf,
+ err = m_copyback((struct mbuf *)crp->crp_buf,
crd->crd_skip, crd->crd_len, sc->op_buf, M_NOWAIT);
else if (crp->crp_flags & CRYPTO_F_IOV)
cuio_copyback((struct uio *)crp->crp_buf,