linux/drivers/xen
Ian Campbell 9e7860cee1 xen/xenbus: Reject replies with payload > XENSTORE_PAYLOAD_MAX.
Haogang Chen found out that:

 There is a potential integer overflow in process_msg() that could result
 in cross-domain attack.

 	body = kmalloc(msg->hdr.len + 1, GFP_NOIO | __GFP_HIGH);

 When a malicious guest passes 0xffffffff in msg->hdr.len, the subsequent
 call to xb_read() would write to a zero-length buffer.

 The other end of this connection is always the xenstore backend daemon
 so there is no guest (malicious or otherwise) which can do this. The
 xenstore daemon is a trusted component in the system.

 However this seem like a reasonable robustness improvement so we should
 have it.

And Ian when read the API docs found that:
        The payload length (len field of the header) is limited to 4096
        (XENSTORE_PAYLOAD_MAX) in both directions.  If a client exceeds the
        limit, its xenstored connection will be immediately killed by
        xenstored, which is usually catastrophic from the client's point of
        view.  Clients (particularly domains, which cannot just reconnect)
        should avoid this.

so this patch checks against that instead.

This also avoids a potential integer overflow pointed out by Haogang Chen.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Haogang Chen <haogangchen@gmail.com>
CC: stable@kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
2012-01-04 17:02:03 -05:00
..
xen-pciback Xen: consolidate and simplify struct xenbus_driver instantiation 2012-01-04 17:01:17 -05:00
xenbus xen/xenbus: Reject replies with payload > XENSTORE_PAYLOAD_MAX. 2012-01-04 17:02:03 -05:00
xenfs xen: Add xenbus device driver 2011-12-16 13:29:39 -05:00
balloon.c xen/balloon: Avoid OOM when requesting highmem 2011-11-16 12:13:43 -05:00
biomerge.c xen: define BIOVEC_PHYS_MERGEABLE() 2010-10-18 10:40:28 -04:00
cpu_hotplug.c Merge branch 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6 2009-12-11 12:18:16 -08:00
events.c xen/events: prevent calling evtchn_get on invalid channels 2011-12-16 11:25:54 -05:00
evtchn.c xen/event: Add reference counting to event channels 2011-11-21 17:14:48 -05:00
features.c xen: clean up asm/xen/hypervisor.h 2008-12-16 21:50:31 +01:00
gntalloc.c xen-gntalloc: introduce missing kfree 2012-01-03 13:39:04 -05:00
gntdev.c xen/grant-table: Support mappings required by blkback 2011-12-20 17:07:27 -05:00
grant-table.c xen/grant-table: Support mappings required by blkback 2011-12-20 17:07:27 -05:00
Kconfig xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
Makefile xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
manage.c xen: Add export.h for THIS_MODULE/EXPORT_SYMBOL to various xen users. 2011-10-31 19:32:11 -04:00
pci.c Merge branch 'stable/cleanups-3.2' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2011-11-06 20:13:34 -08:00
platform-pci.c xen: no need to delay xen_setup_shutdown_event for hvm guests anymore 2011-02-25 16:43:03 +00:00
privcmd.c xen/privcmd: Remove unused support for arch specific privcmp mmap 2011-12-16 13:29:42 -05:00
privcmd.h xen: Add privcmd device driver 2011-12-16 13:29:31 -05:00
swiotlb-xen.c xen: Add export.h for THIS_MODULE/EXPORT_SYMBOL to various xen users. 2011-10-31 19:32:11 -04:00
sys-hypervisor.c drivers/xen/sys-hypervisor: Cleanup code/data sections definitions 2011-05-19 11:30:41 -04:00
tmem.c xen: prepare tmem shim to handle frontswap 2011-06-17 15:06:20 -06:00
xen-balloon.c xen: use static initializers in xen-balloon.c 2011-07-29 13:45:45 -04:00
xen-selfballoon.c Merge branches 'stable/bug.fixes-3.2' and 'stable/mmu.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen 2011-10-25 09:17:47 +02:00
xencomm.c include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h 2010-03-30 22:02:32 +09:00