lkml.org 
[lkml]   [2023]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] KVM: Protect vcpu->pid dereference via debugfs with RCU
From
On Sat, 11 Feb 2023 01:07:19 +0000, Sean Christopherson wrote:
> Wrap the vcpu->pid dereference in the debugfs hook vcpu_get_pid() with
> proper RCU read (un)lock. Unlike the code in kvm_vcpu_ioctl(),
> vcpu_get_pid() is not a simple access; the pid pointer is passed to
> pid_nr() and fully dereferenced if the pointer is non-NULL.
>
> Failure to acquire RCU could result in use-after-free of the old pid if
> a different task invokes KVM_RUN and puts the last reference to the old
> vcpu->pid between vcpu_get_pid() reading the pointer and dereferencing it
> in pid_nr().
>
> [...]

Applied to kvm-x86 generic, thanks!

[1/1] KVM: Protect vcpu->pid dereference via debugfs with RCU
https://github.com/kvm-x86/linux/commit/76021e96d781

--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes

\
 
 \ /
  Last update: 2023-06-02 03:22    [W:0.030 / U:1.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site