From 41a45098bac2247db629acb1612a87f4586172eb Mon Sep 17 00:00:00 2001 From: bluhm Date: Thu, 23 Dec 2021 10:09:16 +0000 Subject: [PATCH] Disk lock was held when returning to userland. Add a missing unlock in vnd ioctl error path. Reported-by: syzbot+6dde3fda33074a256318@syzkaller.appspotmail.com OK jsg@ anton@ --- sys/dev/vnd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 53c12b2fdad..bbd124d8325 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vnd.c,v 1.176 2021/12/21 06:12:03 anton Exp $ */ +/* $OpenBSD: vnd.c,v 1.177 2021/12/23 10:09:16 bluhm Exp $ */ /* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */ /* @@ -498,6 +498,7 @@ fail: if ((error = disk_lock(&sc->sc_dk)) != 0) goto fail; if (sc->sc_flags & VNF_INITED) { + disk_unlock(&sc->sc_dk); error = EBUSY; goto fail; } -- 2.20.1