linux/arch/x86/include/asm/xen
Jan Beulich cf47a83fb0 xen/hypercall: fix hypercall fallback code for very old hypervisors
While copying the argument structures in HYPERVISOR_event_channel_op()
and HYPERVISOR_physdev_op() into the local variable is sufficiently
safe even if the actual structure is smaller than the container one,
copying back eventual output values the same way isn't: This may
collide with on-stack variables (particularly "rc") which may change
between the first and second memcpy() (i.e. the second memcpy() could
discard that change).

Move the fallback code into out-of-line functions, and handle all of
the operations known by this old a hypervisor individually: Some don't
require copying back anything at all, and for the rest use the
individual argument structures' sizes rather than the container's.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
[v2: Reduce #define/#undef usage in HYPERVISOR_physdev_op_compat().]
[v3: Fix compile errors when modules use said hypercalls]
[v4: Add xen_ prefix to the HYPERCALL_..]
[v5: Alter the name and only EXPORT_SYMBOL_GPL one of them]
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2012-11-04 10:40:42 -05:00
..
events.h xen: implement IRQ_WORK_VECTOR handler 2012-05-07 15:33:17 -04:00
hypercall.h xen/hypercall: fix hypercall fallback code for very old hypervisors 2012-11-04 10:40:42 -05:00
hypervisor.h x86: remove obsolete comment from asm/xen/hypervisor.h 2012-10-30 09:27:32 -04:00
interface_32.h xen: implement XENMEM_machphys_mapping 2010-11-12 15:00:06 -08:00
interface_64.h xen: implement XENMEM_machphys_mapping 2010-11-12 15:00:06 -08:00
interface.h Merge commit 'v3.7-rc1' into stable/for-linus-3.7 2012-10-19 15:19:19 -04:00
page.h xen/m2p: do not reuse kmap_op->dev_bus_addr 2012-09-12 11:21:40 -04:00
pci.h xen/pci: Squash pci_xen_initial_domain and xen_setup_pirqs together. 2011-07-11 13:19:30 -04:00
swiotlb-xen.h xen/swiotlb: Use the swiotlb_late_init_with_tbl to init Xen-SWIOTLB late when PV PCI is used. 2012-09-17 12:58:16 -04:00
trace_types.h xen/trace: add multicall tracing 2011-07-18 15:43:26 -07:00