linux/include
Christoffer Dall b68bf84b71 KVM: Protect device ops->create and list_add with kvm->lock
commit a28ebea2ad upstream.

KVM devices were manipulating list data structures without any form of
synchronization, and some implementations of the create operations also
suffered from a lack of synchronization.

Now when we've split the xics create operation into create and init, we
can hold the kvm->lock mutex while calling the create operation and when
manipulating the devices list.

The error path in the generic code gets slightly ugly because we have to
take the mutex again and delete the device from the list, but holding
the mutex during anon_inode_getfd or releasing/locking the mutex in the
common non-error path seemed wrong.

Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
[bwh: Backported to 3.16:
 - Drop change to a failure path that doesn't exist in kvm_vgic_create() 
 - Adjust filename, context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-03-25 17:32:35 +00:00
..
acpi ACPICA: Tables: Enable default 64-bit FADT addresses favor 2015-07-15 10:01:11 +01:00
asm-generic Make asm/word-at-a-time.h available on all architectures 2018-10-21 08:46:11 +01:00
clocksource drivers: clocksource: add support for ARM architected timer event stream 2013-09-26 09:48:00 +01:00
crypto crypto: vmac - separate tfm and request context 2018-12-16 22:08:08 +00:00
drm drm: Allow determining if current task is output poll worker 2018-06-16 22:22:18 +01:00
dt-bindings pinctrl: dra: dt-bindings: Fix output pull up/down 2014-11-27 11:22:05 +00:00
keys KEYS: Separate the kernel signature checking keyring from module signing 2013-09-25 17:17:01 +01:00
kvm arm/arm64: KVM: Require in-kernel vgic for the arch timers 2015-05-20 13:25:52 +01:00
linux KVM: Protect device ops->create and list_add with kvm->lock 2019-03-25 17:32:35 +00:00
math-emu math-emu: fix floating-point to integer overflow detection 2014-01-07 18:36:24 -06:00
media media: v4l: event: Prevent freeing event subscriptions while accessed 2018-11-20 18:05:57 +00:00
memory ddr: add LPDDR2 data from JESD209-2 2012-05-02 00:04:06 -07:00
misc [media] altera-stapl: it is time to move out from staging 2011-09-23 15:00:57 -03:00
net cipso: don't use IPCB() to locate the CIPSO IP option 2019-02-11 17:53:21 +00:00
pcmcia pcmcia/ds.h: introduce helper for pcmcia_driver module boilerplate 2013-03-15 12:26:03 -07:00
ras edac: add support for error type "Info" 2013-02-21 14:16:27 -03:00
rdma RDMA/ucma: Introduce safer rdma_addr_size() variants 2018-10-21 08:45:39 +01:00
rxrpc atomic: use <linux/atomic.h> 2011-07-26 16:49:47 -07:00
scsi scsi: libsas: remove the numbering for each event enum 2018-06-16 22:21:30 +01:00
sound ALSA: core: Assure control device to be registered at last 2018-11-20 18:04:56 +00:00
target target/iscsi: Fix iSCSI task reassignment handling 2018-02-13 18:42:18 +00:00
trace tracing/x86/xen: Remove zero data size trace events trace_xen_mmu_flush_tlb{_all} 2018-10-21 08:46:06 +01:00
uapi kexec: Fix make headers_check 2018-11-20 18:06:02 +00:00
video udlfb: set optimal write delay 2018-12-16 22:08:22 +00:00
xen xen: Add xen_arch_suspend() 2018-06-16 22:22:30 +01:00
Kbuild UAPI: remove empty Kbuild files 2013-04-30 17:04:09 -07:00