linux-kernel-test/include/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
..
interface xen/xenbus: Reject replies with payload > XENSTORE_PAYLOAD_MAX. 2012-01-04 17:02:03 -05:00
balloon.h xen: add an "highmem" parameter to alloc_xenballooned_pages 2011-09-29 09:56:52 -04:00
events.h xen/event: Add reference counting to event channels 2011-11-21 17:14:48 -05:00
evtchn.h xen: add /dev/xen/evtchn driver 2009-03-30 09:26:49 -07:00
features.h
gntalloc.h xen/gntalloc,gntdev: Add unmap notify ioctl 2011-02-14 14:16:17 -05:00
gntdev.h xen/gntalloc,gntdev: Add unmap notify ioctl 2011-02-14 14:16:17 -05:00
grant_table.h xen/grant-table: Support mappings required by blkback 2011-12-20 17:07:27 -05:00
hvc-console.h treewide: use __printf not __attribute__((format(printf,...))) 2011-10-31 17:30:54 -07:00
hvm.h x86/xen: event channels delivery on HVM. 2010-07-22 16:45:59 -07:00
Kbuild xen: add privcmd driver 2010-10-20 16:22:29 -07:00
page.h xen: allow balloon driver to use more than one memory region 2011-09-29 11:12:10 -04:00
platform_pci.h xen: Remove hanging references to CONFIG_XEN_PLATFORM_PCI 2011-11-16 12:13:42 -05:00
privcmd.h xen: fix header export to userspace 2010-11-16 10:57:05 -08:00
swiotlb-xen.h swiotlb-xen: SWIOTLB library for Xen PV guest with PCI passthrough. 2010-07-27 11:51:00 -04:00
tmem.h xen: tmem: self-ballooning and frontswap-selfshrinking 2011-07-08 12:26:21 -06:00
xen-ops.h xen: suspend: add "arch" to pre/post suspend hooks 2011-02-25 16:43:12 +00:00
xen.h xen: move Xen-testing predicates to common header 2009-11-04 08:47:24 -08:00
xenbus_dev.h xen: Add xenbus_backend device 2011-12-16 13:29:41 -05:00
xenbus.h Xen: consolidate and simplify struct xenbus_driver instantiation 2012-01-04 17:01:17 -05:00
xencomm.h xen: import arch generic part of xencomm 2008-04-24 23:57:32 +02:00