diff mbox

linux-next: manual merge of the kvm tree with Linus' tree

Message ID 20180202112029.0f4aa558@canb.auug.org.au (mailing list archive)
State New, archived
Headers show

Commit Message

Stephen Rothwell Feb. 2, 2018, 12:20 a.m. UTC
Hi Radim,

On Thu, 1 Feb 2018 16:22:44 +0100 Radim Krčmář <rkrcmar@redhat.com> wrote:
>
> I wasn't sure if the pti top branch is final, so I pulled hyper-v topic
> branch that also also contains v4.15.  This and the SEV feature
> conflicts should be gone now,

That merge would have been a good place to add the following merge
resolution fix patch I have been carrying:

From: Eric Biggers <ebiggers@google.com>
Subject: KVM: x86: don't forget vcpu_put() in kvm_arch_vcpu_ioctl_set_sregs()
Date: Thu, 21 Dec 2017 01:30:30 +0100

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 <syzkaller@googlegroups.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
---
 arch/x86/kvm/x86.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Radim Krčmář Feb. 2, 2018, 5:22 p.m. UTC | #1
2018-02-02 11:20+1100, Stephen Rothwell:
> Hi Radim,
> 
> On Thu, 1 Feb 2018 16:22:44 +0100 Radim Krčmář <rkrcmar@redhat.com> wrote:
> >
> > I wasn't sure if the pti top branch is final, so I pulled hyper-v topic
> > branch that also also contains v4.15.  This and the SEV feature
> > conflicts should be gone now,
> 
> That merge would have been a good place to add the following merge
> resolution fix patch I have been carrying:

Yes, should have been there ... I've slapped the patch on top, thanks
for noticing.

> From: Eric Biggers <ebiggers@google.com>
> Subject: KVM: x86: don't forget vcpu_put() in kvm_arch_vcpu_ioctl_set_sregs()
> Date: Thu, 21 Dec 2017 01:30:30 +0100
> 
> 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 <syzkaller@googlegroups.com>
> Signed-off-by: Eric Biggers <ebiggers@google.com>
> ---
>  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;
> 
> -- 
> Cheers,
> Stephen Rothwell
diff mbox

Patch

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;