android_kernel_google_msm/include/xen
David Vrabel ffac746691 xen: Add RING_COPY_REQUEST()
commit 454d5d882c7e412b840e3c99010fe81a9862f6fb upstream.

Using RING_GET_REQUEST() on a shared ring is easy to use incorrectly
(i.e., by not considering that the other end may alter the data in the
shared ring while it is being inspected).  Safe usage of a request
generally requires taking a local copy.

Provide a RING_COPY_REQUEST() macro to use instead of
RING_GET_REQUEST() and an open-coded memcpy().  This takes care of
ensuring that the copy is done correctly regardless of any possible
compiler optimizations.

Use a volatile source to prevent the compiler from reordering or
omitting the copy.

This is part of XSA155.

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Signed-off-by: Zefan Li <lizefan@huawei.com>
2016-10-26 23:15:39 +08:00
..
interface xen: Add RING_COPY_REQUEST() 2016-10-26 23:15:39 +08:00
Kbuild
balloon.h xen-balloon: convert sysdev_class to a regular subsystem 2011-12-14 15:32:50 -08:00
events.h xen/events: don't bind non-percpu VIRQs with percpu chip 2015-09-18 09:20:42 +08:00
evtchn.h
features.h
gntalloc.h
gntdev.h
grant_table.h xen/m2p: do not reuse kmap_op->dev_bus_addr 2012-10-02 10:30:06 -07:00
hvc-console.h treewide: use __printf not __attribute__((format(printf,...))) 2011-10-31 17:30:54 -07:00
hvm.h
page.h
platform_pci.h xen: Remove hanging references to CONFIG_XEN_PLATFORM_PCI 2011-11-16 12:13:42 -05:00
privcmd.h
swiotlb-xen.h X86 & IA64: adapt for dma_map_ops changes 2012-03-28 16:36:31 +02:00
tmem.h xen/tmem: cleanup 2012-03-20 15:34:18 -04:00
xen-ops.h Disintegrate asm/system.h for IA64 2012-03-28 18:30:02 +01:00
xen.h
xenbus.h include/ and checkpatch: prefer __scanf to __attribute__((format(scanf,...) 2012-03-23 16:58:36 -07:00
xenbus_dev.h xen: Add xenbus_backend device 2011-12-16 13:29:41 -05:00
xencomm.h