[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20221028092631.117438-1-eiichi.tsukata@nutanix.com>
Date: Fri, 28 Oct 2022 09:26:31 +0000
From: Eiichi Tsukata <eiichi.tsukata@...anix.com>
To: seanjc@...gle.com, pbonzini@...hat.com, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
x86@...nel.org, hpa@...or.com, kvm@...r.kernel.org,
linux-kernel@...r.kernel.org, ankur.a.arora@...cle.com,
dwmw@...zon.co.uk, joao.m.martins@...cle.com
Cc: Eiichi Tsukata <eiichi.tsukata@...anix.com>,
syzbot+6f0c896c5a9449a10ded@...kaller.appspotmail.com
Subject: [PATCH] KVM: x86/xen: Fix eventfd error handling in kvm_xen_eventfd_assign()
Should not call eventfd_ctx_put() in case of error.
Fixes: 2fd6df2f2b47 ("KVM: x86/xen: intercept EVTCHNOP_send from guests")
Reported-by: syzbot+6f0c896c5a9449a10ded@...kaller.appspotmail.com
Signed-off-by: Eiichi Tsukata <eiichi.tsukata@...anix.com>
---
arch/x86/kvm/xen.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c
index 93c628d3e3a9..a357994982c6 100644
--- a/arch/x86/kvm/xen.c
+++ b/arch/x86/kvm/xen.c
@@ -1716,7 +1716,7 @@ static int kvm_xen_eventfd_assign(struct kvm *kvm,
if (ret == -ENOSPC)
ret = -EEXIST;
out:
- if (eventfd)
+ if (eventfd && !IS_ERR(eventfd))
eventfd_ctx_put(eventfd);
kfree(evtchnfd);
return ret;
--
2.37.3
Powered by blists - more mailing lists