qemu-patch-raspberry4/docs
Paolo Bonzini 3568e11940 memory: avoid "resurrection" of dead FlatViews
It's possible for address_space_get_flatview() as it currently stands
to cause a use-after-free for the returned FlatView, if the reference
count is incremented after the FlatView has been replaced by a writer:

   thread 1             thread 2             RCU thread
  -------------------------------------------------------------
   rcu_read_lock
   read as->current_map
                        set as->current_map
                        flatview_unref
                           '--> call_rcu
   flatview_ref
     [ref=1]
   rcu_read_unlock
                                             flatview_destroy
   <badness>

Since FlatViews are not updated very often, we can just detect the
situation using a new atomic op atomic_fetch_inc_nonzero, similar to
Linux's atomic_inc_not_zero, which performs the refcount increment only if
it hasn't already hit zero.  This is similar to Linux commit de09a9771a53
("CRED: Fix get_task_cred() and task_state() to not resurrect dead
credentials", 2010-07-29).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 447b0d0b9e)
 Conflicts:
	docs/devel/atomics.txt
* drop documentation ref to atomic_fetch_xor
* prereq for 166206845f
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
2017-12-04 22:03:33 -06:00
..
config docs: create config/, devel/ and spin/ subdirectories 2017-06-07 18:22:03 +02:00
devel memory: avoid "resurrection" of dead FlatViews 2017-12-04 22:03:33 -06:00
interop vhost-user: fix legacy cross-endian configurations 2017-08-02 00:13:25 +03:00
specs docs: fix broken paths to docs/specs/ivshmem-spec.txt 2017-07-31 13:13:01 +03:00
spin docs: create config/, devel/ and spin/ subdirectories 2017-06-07 18:22:03 +02:00
COLO-FT.txt docs: fix COLO architecture diagram 2016-11-15 15:36:21 +08:00
block-replication.txt docs: block replication's description 2016-09-13 11:00:56 +01:00
bootindex.txt docs qemu-doc: Avoid ide-drive, it's deprecated 2017-06-04 18:42:55 +03:00
ccid.txt libcacard: improve documentation 2014-06-10 07:44:01 +02:00
colo-proxy.txt docs/colo-proxy.txt: Update colo-proxy usage of net driver with vnet_header 2017-07-17 20:13:54 +08:00
generic-loader.txt docs/generic-loader: Update the document 2016-10-17 19:22:16 +01:00
igd-assign.txt vfio/pci: Add IGD documentation 2016-05-26 11:12:05 -06:00
image-fuzzer.txt docs: List all image elements currently supported by the fuzzer 2014-09-22 11:39:35 +01:00
memory-hotplug.txt docs: update documentation for memory hot unplug 2015-04-27 21:07:38 +02:00
multi-thread-compression.txt docs/multi-thread-compression: Fix wrong command string 2016-06-07 18:19:24 +03:00
multiseat.txt maint: remove / fix many doubled words 2015-09-11 10:21:38 +03:00
nvdimm.txt docs: add document to explain the usage of vNVDIMM 2017-02-17 21:52:30 +02:00
pci_expander_bridge.txt pxb: cleanup 2016-03-11 16:59:12 +02:00
pcie.txt doc/pcie: correct command line examples 2017-01-10 07:02:52 +02:00
qcow2-cache.txt docs: fix broken paths to docs/interop/qcow2.txt 2017-07-31 13:12:35 +03:00
qdev-device-use.txt docs/qdev-device-use.txt: update section Default Devices 2017-06-04 18:42:55 +03:00
qemu_logo.pdf docs: add qemu logo to pdf 2017-01-16 10:11:43 +01:00
qemupciserial.inf Docs: Introduce multiport serial support in qemupciserial.inf. 2014-03-12 10:33:23 +01:00
rdma.txt rdma: Fix incorrect description in comments 2014-09-20 17:55:53 +04:00
replay.txt replay: add record/replay for audio passthrough 2017-03-01 15:11:44 +01:00
spice-port-fqdn.txt docs: add spice-port-fqdn.txt 2012-12-17 14:01:41 +01:00
throttle.txt docs: Fix description of the leaky bucket algorithm in throttle.txt 2016-09-13 18:12:34 +03:00
usb-storage.txt usb: Fix typo in documentation 2017-01-24 23:26:52 +03:00
usb2.txt docs: fix broken paths to docs/config/ich9-ehci-uhci.cfg 2017-07-31 13:12:55 +03:00
virtio-balloon-stats.txt virtio-balloon: return empty data when no stats are available 2014-05-25 12:46:58 +03:00
xbzrle.txt docs/xbzrle: correction 2016-10-13 17:23:53 +02:00
xen-save-devices-state.txt docs: Belatedly update for move of qmp-commands.txt 2016-10-07 19:22:11 +02:00