kernel_optimize_test/include/xen/interface
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
..
hvm x86: Call HVMOP_pagetable_dying on exit_mmap. 2010-07-26 23:13:26 -07:00
io xen/xenbus: Reject replies with payload > XENSTORE_PAYLOAD_MAX. 2012-01-04 17:02:03 -05:00
callback.h
elfnote.h Fix common misspellings 2011-03-31 11:26:23 -03:00
event_channel.h
features.h xen: support GSI -> pirq remapping in PV on HVM guests 2010-10-22 21:25:42 +01:00
grant_table.h xen/granttable: Introducing grant table V2 stucture 2011-11-22 09:23:44 -05:00
memory.h xen: implement XENMEM_machphys_mapping 2010-11-12 15:00:06 -08:00
physdev.h xen/pci: support multi-segment systems 2011-09-22 16:23:46 -04:00
platform.h xen/acpi: Domain0 acpi parser related platform hypercall 2011-09-26 11:04:39 -07:00
sched.h watchdog: Xen watchdog driver 2011-03-15 16:02:18 +00:00
vcpu.h
version.h
xen.h xen/granttable: Introducing grant table V2 stucture 2011-11-22 09:23:44 -05:00
xencomm.h