linux/drivers/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
..
xen-pciback Merge commit 'v3.7-rc1' into stable/for-linus-3.7 2012-10-19 15:19:19 -04:00
xenbus xen/xenbus: fix overflow check in xenbus_file_write() 2012-10-30 09:57:49 -04:00
xenfs userns: Convert xenfs to use kuid and kgid where appropriate 2012-09-21 03:13:06 -07:00
acpi.c
balloon.c xen: balloon: use correct type for frame_list 2012-10-19 15:18:00 -04:00
biomerge.c
cpu_hotplug.c
dbgp.c xen: dbgp: Fix warning when CONFIG_PCI is not enabled. 2012-10-19 15:19:37 -04:00
events.c xen: events: pirq_check_eoi_map is X86 specific 2012-10-19 15:17:53 -04:00
evtchn.c
fallback.c xen/hypercall: fix hypercall fallback code for very old hypervisors 2012-11-04 10:40:42 -05:00
features.c
gntalloc.c mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
gntdev.c xen/gntdev: don't leak memory from IOCTL_GNTDEV_MAP_GRANT_REF 2012-10-30 09:27:32 -04:00
grant-table.c Merge commit 'v3.7-rc1' into stable/for-linus-3.7 2012-10-19 15:19:19 -04:00
Kconfig
Makefile xen/hypercall: fix hypercall fallback code for very old hypervisors 2012-11-04 10:40:42 -05:00
manage.c
mcelog.c
pci.c
pcpu.c
platform-pci.c
privcmd.c mm: kill vma flag VM_RESERVED and mm->reserved_vm counter 2012-10-09 16:22:19 +09:00
privcmd.h
swiotlb-xen.c Merge branch 'stable/late-swiotlb.v3.3' into stable/for-linus-3.7 2012-09-22 20:01:24 -04:00
sys-hypervisor.c xen: sysfs: fix build warning. 2012-10-19 15:17:51 -04:00
tmem.c
xen-acpi-processor.c
xen-balloon.c
xen-selfballoon.c
xencomm.c