linux-stable/arch
Paolo Bonzini d56f5136b0 KVM: let kvm_destroy_vm_debugfs clean up vCPU debugfs directories
After commit 63d0434 ("KVM: x86: move kvm_create_vcpu_debugfs after
last failure point") we are creating the pre-vCPU debugfs files
after the creation of the vCPU file descriptor.  This makes it
possible for userspace to reach kvm_vcpu_release before
kvm_create_vcpu_debugfs has finished.  The vcpu->debugfs_dentry
then does not have any associated inode anymore, and this causes
a NULL-pointer dereference in debugfs_create_file.

The solution is simply to avoid removing the files; they are
cleaned up when the VM file descriptor is closed (and that must be
after KVM_CREATE_VCPU returns).  We can stop storing the dentry
in struct kvm_vcpu too, because it is not needed anywhere after
kvm_create_vcpu_debugfs returns.

Reported-by: syzbot+705f4401d5a93a59b87d@syzkaller.appspotmail.com
Fixes: 63d0434837 ("KVM: x86: move kvm_create_vcpu_debugfs after last failure point")
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2020-06-04 11:00:54 -04:00
..
alpha alpha: simplify detection of memory zone boundaries 2020-06-03 20:09:43 -07:00
arc mm/thp: rename pmd_mknotpresent() as pmd_mkinvalid() 2020-06-03 20:09:49 -07:00
arm media updates for v5.8-rc1 2020-06-03 20:59:38 -07:00
arm64 KVM: let kvm_destroy_vm_debugfs clean up vCPU debugfs directories 2020-06-04 11:00:54 -04:00
c6x mm: free_area_init: use maximal zone PFNs rather than zone sizes 2020-06-03 20:09:43 -07:00
csky csky: simplify detection of memory zone boundaries 2020-06-03 20:09:43 -07:00
h8300 mm: free_area_init: use maximal zone PFNs rather than zone sizes 2020-06-03 20:09:43 -07:00
hexagon mm: free_area_init: use maximal zone PFNs rather than zone sizes 2020-06-03 20:09:43 -07:00
ia64 Merge branch 'akpm' (patches from Andrew) 2020-06-03 20:24:15 -07:00
m68k m68k: mm: simplify detection of memory zone boundaries 2020-06-03 20:09:43 -07:00
microblaze mm: use free_area_init() instead of free_area_init_nodes() 2020-06-03 20:09:43 -07:00
mips Merge branch 'akpm' (patches from Andrew) 2020-06-03 20:24:15 -07:00
nds32 mm: free_area_init: use maximal zone PFNs rather than zone sizes 2020-06-03 20:09:43 -07:00
nios2 mm: free_area_init: use maximal zone PFNs rather than zone sizes 2020-06-03 20:09:43 -07:00
openrisc mm: free_area_init: use maximal zone PFNs rather than zone sizes 2020-06-03 20:09:43 -07:00
parisc Merge branch 'akpm' (patches from Andrew) 2020-06-03 20:24:15 -07:00
powerpc Merge branch 'akpm' (patches from Andrew) 2020-06-03 20:24:15 -07:00
riscv Merge branch 'akpm' (patches from Andrew) 2020-06-03 20:24:15 -07:00
s390 Merge branch 'akpm' (patches from Andrew) 2020-06-03 20:24:15 -07:00
sh mm/hugetlb: define a generic fallback for arch_clear_hugepage_flags() 2020-06-03 20:09:46 -07:00
sparc sparc32: register memory occupied by kernel as memblock.memory 2020-06-03 20:09:49 -07:00
um mm: free_area_init: use maximal zone PFNs rather than zone sizes 2020-06-03 20:09:43 -07:00
unicore32 unicore32: simplify detection of memory zone boundaries 2020-06-03 20:09:43 -07:00
x86 KVM: let kvm_destroy_vm_debugfs clean up vCPU debugfs directories 2020-06-04 11:00:54 -04:00
xtensa Merge branch 'akpm' (patches from Andrew) 2020-06-03 20:24:15 -07:00
.gitignore
Kconfig scs: Remove references to asm/scs.h from core code 2020-05-18 17:47:45 +01:00