linux-stable/virt/kvm
Greg Kroah-Hartman 4e4a0cf997 kvm: properly check debugfs dentry before using it
[ Upstream commit 8ed0579c12 ]

debugfs can now report an error code if something went wrong instead of
just NULL.  So if the return value is to be used as a "real" dentry, it
needs to be checked if it is an error before dereferencing it.

This is now happening because of ff9fb72bc0 ("debugfs: return error
values, not NULL").  syzbot has found a way to trigger multiple debugfs
files attempting to be created, which fails, and then the error code
gets passed to dentry_path_raw() which obviously does not like it.

Reported-by: Eric Biggers <ebiggers@kernel.org>
Reported-and-tested-by: syzbot+7857962b4d45e602b8ad@syzkaller.appspotmail.com
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: kvm@vger.kernel.org
Acked-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-05 15:37:59 +01:00
..
arm kvm: arm/arm64: Fix stage2_flush_memslot for 4 level page table 2019-11-24 08:22:53 +01:00
async_pf.c kvm,async_pf: Use swq_has_sleeper() 2017-09-15 16:57:11 +02:00
async_pf.h KVM: fix checkpatch.pl errors in kvm/async_pf.h 2015-06-19 17:16:25 +02:00
coalesced_mmio.c KVM: coalesced_mmio: add bounds checking 2019-09-21 07:15:28 +02:00
coalesced_mmio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
eventfd.c KVM: irqfd: fix race between EPOLLHUP and irq_bypass_register_consumer 2018-08-24 13:09:21 +02:00
irqchip.c KVM: fix spectrev1 gadgets 2019-05-16 19:42:22 +02:00
Kconfig License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
kvm_main.c kvm: properly check debugfs dentry before using it 2019-12-05 15:37:59 +01:00
vfio.c vfio: New external user group/file match 2017-06-28 13:50:05 -06:00
vfio.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00