Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756954AbdLUAZ2 (ORCPT ); Wed, 20 Dec 2017 19:25:28 -0500 Received: from mail-io0-f196.google.com ([209.85.223.196]:45933 "EHLO mail-io0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755795AbdLUAZZ (ORCPT ); Wed, 20 Dec 2017 19:25:25 -0500 X-Google-Smtp-Source: ACJfBotNzVzZ7BeL5tPs9ejbiwxu++uVGnXVgYd9W89R3hJW2Z5HzHfU+W+yluye9tSHFRfjrFVuGg== From: Eric Biggers To: kvm@vger.kernel.org Cc: pbonzini@redhat.com, rkrcmar@redhat.com, tianyu.lan@intel.com, christoffer.dall@linaro.org, x86@kernel.org, linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com, Eric Biggers Subject: [PATCH linux-next] KVM: x86: don't forget vcpu_put() in kvm_arch_vcpu_ioctl_set_sregs() Date: Wed, 20 Dec 2017 16:24:27 -0800 Message-Id: <20171221002427.82325-1-ebiggers3@gmail.com> X-Mailer: git-send-email 2.15.1.620.gb9897f4670-goog In-Reply-To: <001a1148cc3acf967c0560c7b760@google.com> References: <001a1148cc3acf967c0560c7b760@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 957 Lines: 29 From: Eric Biggers Due to a bad merge resolution between commit f29810335965 ("KVM/x86: Check input paging mode when cs.l is set") and commit b4ef9d4e8cb8 ("KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_sregs"), there is a case in kvm_arch_vcpu_ioctl_set_sregs() where vcpu_put() is not called after vcpu_get(). Fix it. Reported-by: syzbot Signed-off-by: Eric Biggers --- arch/x86/kvm/x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index ea3a98196753..f4e8b5089b28 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -7624,7 +7624,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, goto out; if (kvm_valid_sregs(vcpu, sregs)) - return -EINVAL; + goto out; apic_base_msr.data = sregs->apic_base; apic_base_msr.host_initiated = true; -- 2.15.1.620.gb9897f4670-goog