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
balloon.h
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
hvc-console.h
hvm.h
Kbuild
page.h
platform_pci.h
privcmd.h
swiotlb-xen.h
tmem.h
xen-ops.h
xen.h
xenbus.h
xenbus_dev.h
xencomm.h