Linux KVM/arm64 development list
 help / color / mirror / Atom feed
* [PULL] KVM/ARM updates for 4.5-rc7
@ 2016-03-02  9:27 Marc Zyngier
  2016-03-02  9:27 ` [PATCH] arm/arm64: KVM: Fix ioctl error handling Marc Zyngier
  2016-03-02  9:35 ` [PULL] KVM/ARM updates for 4.5-rc7 Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: Marc Zyngier @ 2016-03-02  9:27 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: Christoffer Dall, Michael S. Tsirkin, linux-arm-kernel, kvm,
	kvmarm, Gleb Natapov

Hi Paolo,

I really thought that the previous PR was the last for this release,
but Michael rightly decided to prove me wrong. Oh well.

Please pull!

       M.

The following changes since commit fd451b90e78c4178bcfc5072f2b2b637500c109a:

  arm64: KVM: vgic-v3: Restore ICH_APR0Rn_EL2 before ICH_APR1Rn_EL2 (2016-02-24 17:25:58 +0000)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvm-arm-for-4.5-rc7

for you to fetch changes up to 4cad67fca3fc952d6f2ed9e799621f07666a560f:

  arm/arm64: KVM: Fix ioctl error handling (2016-02-29 09:56:40 +0000)

----------------------------------------------------------------
KVM/ARM fixes for 4.5-rc7

- Fix ioctl error handling on the timer path

----------------------------------------------------------------
Michael S. Tsirkin (1):
      arm/arm64: KVM: Fix ioctl error handling

 arch/arm/kvm/guest.c   | 2 +-
 arch/arm64/kvm/guest.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] arm/arm64: KVM: Fix ioctl error handling
  2016-03-02  9:27 [PULL] KVM/ARM updates for 4.5-rc7 Marc Zyngier
@ 2016-03-02  9:27 ` Marc Zyngier
  2016-03-02  9:35 ` [PULL] KVM/ARM updates for 4.5-rc7 Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Zyngier @ 2016-03-02  9:27 UTC (permalink / raw)
  To: Paolo Bonzini
  Cc: kvm, Michael S. Tsirkin, Gleb Natapov, kvmarm, linux-arm-kernel

From: "Michael S. Tsirkin" <mst@redhat.com>

Calling return copy_to_user(...) in an ioctl will not
do the right thing if there's a pagefault:
copy_to_user returns the number of bytes not copied
in this case.

Fix up kvm to do
	return copy_to_user(...)) ?  -EFAULT : 0;

everywhere.

Cc: stable@vger.kernel.org
Acked-by: Christoffer Dall <christoffer.dall@linaro.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
---
 arch/arm/kvm/guest.c   | 2 +-
 arch/arm64/kvm/guest.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kvm/guest.c b/arch/arm/kvm/guest.c
index 5fa69d7..99361f1 100644
--- a/arch/arm/kvm/guest.c
+++ b/arch/arm/kvm/guest.c
@@ -161,7 +161,7 @@ static int get_timer_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
 	u64 val;
 
 	val = kvm_arm_timer_get_reg(vcpu, reg->id);
-	return copy_to_user(uaddr, &val, KVM_REG_SIZE(reg->id));
+	return copy_to_user(uaddr, &val, KVM_REG_SIZE(reg->id)) ? -EFAULT : 0;
 }
 
 static unsigned long num_core_regs(void)
diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c
index fcb7788..9e54ad7 100644
--- a/arch/arm64/kvm/guest.c
+++ b/arch/arm64/kvm/guest.c
@@ -194,7 +194,7 @@ static int get_timer_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
 	u64 val;
 
 	val = kvm_arm_timer_get_reg(vcpu, reg->id);
-	return copy_to_user(uaddr, &val, KVM_REG_SIZE(reg->id));
+	return copy_to_user(uaddr, &val, KVM_REG_SIZE(reg->id)) ? -EFAULT : 0;
 }
 
 /**
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PULL] KVM/ARM updates for 4.5-rc7
  2016-03-02  9:27 [PULL] KVM/ARM updates for 4.5-rc7 Marc Zyngier
  2016-03-02  9:27 ` [PATCH] arm/arm64: KVM: Fix ioctl error handling Marc Zyngier
@ 2016-03-02  9:35 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2016-03-02  9:35 UTC (permalink / raw)
  To: Marc Zyngier
  Cc: Christoffer Dall, Michael S. Tsirkin, linux-arm-kernel, kvm,
	kvmarm, Gleb Natapov



On 02/03/2016 10:27, Marc Zyngier wrote:
> Hi Paolo,
> 
> I really thought that the previous PR was the last for this release,
> but Michael rightly decided to prove me wrong. Oh well.
> 
> Please pull!
> 
>        M.
> 
> The following changes since commit fd451b90e78c4178bcfc5072f2b2b637500c109a:
> 
>   arm64: KVM: vgic-v3: Restore ICH_APR0Rn_EL2 before ICH_APR1Rn_EL2 (2016-02-24 17:25:58 +0000)
> 
> are available in the git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git tags/kvm-arm-for-4.5-rc7
> 
> for you to fetch changes up to 4cad67fca3fc952d6f2ed9e799621f07666a560f:
> 
>   arm/arm64: KVM: Fix ioctl error handling (2016-02-29 09:56:40 +0000)
> 
> ----------------------------------------------------------------
> KVM/ARM fixes for 4.5-rc7
> 
> - Fix ioctl error handling on the timer path
> 
> ----------------------------------------------------------------
> Michael S. Tsirkin (1):
>       arm/arm64: KVM: Fix ioctl error handling
> 
>  arch/arm/kvm/guest.c   | 2 +-
>  arch/arm64/kvm/guest.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

Pulled, thanks.

Paolo

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-03-02  9:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-02  9:27 [PULL] KVM/ARM updates for 4.5-rc7 Marc Zyngier
2016-03-02  9:27 ` [PATCH] arm/arm64: KVM: Fix ioctl error handling Marc Zyngier
2016-03-02  9:35 ` [PULL] KVM/ARM updates for 4.5-rc7 Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox