tools/libxencall: enforce proper alignment of hypercall buffers
authorJuergen Gross <jgross@suse.com>
Fri, 8 Jun 2018 09:51:12 +0000 (11:51 +0200)
committerWei Liu <wei.liu2@citrix.com>
Tue, 10 Jul 2018 15:04:56 +0000 (16:04 +0100)
commitf5d10dc2909c84e4ffc7240e542c513ed480aa04
tree2a875286c8e80557c796f30230292847bf494295
parentd8fd67feacc18d5ac071a434469a22f7af487cba
tools/libxencall: enforce proper alignment of hypercall buffers

xencall_alloc_buffer() is used throughout Xen tools for allocating
hypercall buffers. Allocation is done at page granularity. For simple
administration each allocated set of pages contains a small header
holding the number of pages of that set. The hypercall buffer is
located directly after the 4 byte sized header, leading to a wrong
alignment for e.g. pointers.

Repair that by using a 16 byte sized header enforcing the same
alignment as malloc().

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libs/call/buffer.c