From aa5628258068caf89b9faf1d886da2b31041123b Mon Sep 17 00:00:00 2001 From: anton Date: Tue, 7 Dec 2021 07:58:56 +0000 Subject: [PATCH] Add missing kernel unlock in error path. ok dv@ Reported-by: syzbot+c773ba1ce9b2d259d27f@syzkaller.appspotmail.com --- sys/arch/amd64/amd64/vmm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/arch/amd64/amd64/vmm.c b/sys/arch/amd64/amd64/vmm.c index 485f5125bda..d0711e8fac2 100644 --- a/sys/arch/amd64/amd64/vmm.c +++ b/sys/arch/amd64/amd64/vmm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vmm.c,v 1.297 2021/12/04 18:51:36 dv Exp $ */ +/* $OpenBSD: vmm.c,v 1.298 2021/12/07 07:58:56 anton Exp $ */ /* * Copyright (c) 2014 Mike Larkin * @@ -1004,8 +1004,10 @@ vmx_mprotect_ept(vm_map_t vm_map, paddr_t sgpa, paddr_t egpa, int prot) __func__, ret, (uint64_t)addr); pte = vmx_pmap_find_pte_ept(pmap, addr); - if (pte == NULL) + if (pte == NULL) { + KERNEL_UNLOCK(); return EFAULT; + } } if (prot & PROT_READ) -- 2.20.1