Go to file
Sean Christopherson 2a20592baf KVM: Stop looking for coalesced MMIO zones if the bus is destroyed
commit 5d3c4c79384af06e3c8e25b7770b6247496b4417 upstream.

Abort the walk of coalesced MMIO zones if kvm_io_bus_unregister_dev()
fails to allocate memory for the new instance of the bus.  If it can't
instantiate a new bus, unregister_dev() destroys all devices _except_ the
target device.   But, it doesn't tell the caller that it obliterated the
bus and invoked the destructor for all devices that were on the bus.  In
the coalesced MMIO case, this can result in a deleted list entry
dereference due to attempting to continue iterating on coalesced_zones
after future entries (in the walk) have been deleted.

Opportunistically add curly braces to the for-loop, which encompasses
many lines but sneaks by without braces due to the guts being a single
if statement.

Fixes: f65886606c ("KVM: fix memory leak in kvm_io_bus_unregister_dev()")
Cc: stable@vger.kernel.org
Reported-by: Hao Sun <sunhao.th@gmail.com>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20210412222050.876100-3-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-14 09:50:04 +02:00
arch KVM: arm/arm64: Fix KVM_VGIC_V3_ADDR_TYPE_REDIST read 2021-05-14 09:50:04 +02:00
block block: return -EBUSY when there are open partitions in blkdev_reread_part 2021-04-28 13:39:59 +02:00
certs
crypto async_xor: increase src_offs when dropping destination page 2021-05-14 09:49:59 +02:00
Documentation dt-bindings: net: ethernet-controller: fix typo in NVMEM 2021-04-14 08:42:12 +02:00
drivers drm/amdgpu: fix concurrent VM flushes on Vega/Navi v2 2021-05-14 09:50:01 +02:00
fs io_uring: truncate lengths larger than MAX_RW_COUNT on provide buffers 2021-05-14 09:49:55 +02:00
include KVM: Stop looking for coalesced MMIO zones if the bus is destroyed 2021-05-14 09:50:04 +02:00
init
ipc
kernel tracing: Restructure trace_clock_global() to never block 2021-05-11 14:47:40 +02:00
lib lib/vsprintf.c: remove leftover 'f' and 'F' cases from bstr_printf() 2021-05-11 14:47:40 +02:00
LICENSES
mm mm: ptdump: fix build failure 2021-04-21 13:00:57 +02:00
net cfg80211: scan: drop entry from hidden_list on overflow 2021-05-14 09:50:00 +02:00
samples
scripts kasan: fix hwasan build for gcc 2021-04-28 13:40:02 +02:00
security selinux: add proper NULL termination to the secclass_map permissions 2021-05-14 09:49:59 +02:00
sound ALSA: hda/realtek: Fix speaker amp on HP Envy AiO 32 2021-05-14 09:50:03 +02:00
tools tools/power turbostat: Fix offset overflow issue in index converting 2021-05-11 14:47:40 +02:00
usr
virt KVM: Stop looking for coalesced MMIO zones if the bus is destroyed 2021-05-14 09:50:04 +02:00
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.10.36 2021-05-11 14:47:41 +02:00
README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.