kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] KVM: correct null pid check in kvm_vcpu_yield_to()
@ 2014-09-18 23:40 Sam Bobroff
  2014-09-19 13:33 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Sam Bobroff @ 2014-09-18 23:40 UTC (permalink / raw)
  To: gleb, pbonzini; +Cc: kvm

Correct a simple mistake of checking the wrong variable
before a dereference, resulting in the dereference not being
properly protected by rcu_dereference().

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
---

 virt/kvm/kvm_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 33712fb..688acb0 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1725,7 +1725,7 @@ int kvm_vcpu_yield_to(struct kvm_vcpu *target)
 	rcu_read_lock();
 	pid = rcu_dereference(target->pid);
 	if (pid)
-		task = get_pid_task(target->pid, PIDTYPE_PID);
+		task = get_pid_task(pid, PIDTYPE_PID);
 	rcu_read_unlock();
 	if (!task)
 		return ret;
-- 
2.1.0


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

* Re: [PATCH 1/1] KVM: correct null pid check in kvm_vcpu_yield_to()
  2014-09-18 23:40 [PATCH 1/1] KVM: correct null pid check in kvm_vcpu_yield_to() Sam Bobroff
@ 2014-09-19 13:33 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2014-09-19 13:33 UTC (permalink / raw)
  To: Sam Bobroff, gleb; +Cc: kvm

Il 19/09/2014 01:40, Sam Bobroff ha scritto:
> Correct a simple mistake of checking the wrong variable
> before a dereference, resulting in the dereference not being
> properly protected by rcu_dereference().
> 
> Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
> ---
> 
>  virt/kvm/kvm_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 33712fb..688acb0 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -1725,7 +1725,7 @@ int kvm_vcpu_yield_to(struct kvm_vcpu *target)
>  	rcu_read_lock();
>  	pid = rcu_dereference(target->pid);
>  	if (pid)
> -		task = get_pid_task(target->pid, PIDTYPE_PID);
> +		task = get_pid_task(pid, PIDTYPE_PID);
>  	rcu_read_unlock();
>  	if (!task)
>  		return ret;
> 

Thanks, applying to kvm/master.

Paolo

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

end of thread, other threads:[~2014-09-19 13:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-18 23:40 [PATCH 1/1] KVM: correct null pid check in kvm_vcpu_yield_to() Sam Bobroff
2014-09-19 13:33 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).