xen/public: Correct the definition of GNTTAB_CACHE_SOURCE_GREF
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 17 Oct 2017 14:11:23 +0000 (15:11 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 19 Oct 2017 13:10:45 +0000 (14:10 +0100)
commit5dd3907a2af37060a675dd3bc5a02b7b38dac66c
tree7628db58366380f973822351345be454f1fb3a52
parent8d7b633adab76a778ccf3e3417e903b35333c528
xen/public: Correct the definition of GNTTAB_CACHE_SOURCE_GREF

Discovered when running the XSA-232 PoC on a UBSAN-enabled hypervisor.

  (d79) XSA-232 PoC
  (XEN) ================================================================================
  (XEN) UBSAN: Undefined behaviour in grant_table.c:3217:25
  (XEN) left shift of 1 by 31 places cannot be represented in type 'int'
  (XEN) ----[ Xen-4.10.0-rc  x86_64  debug=y   Tainted:    H ]----

Update all of the GNTTAB_CACHE_* constants to be unsigned integers.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Release-acked-by: Julien Grall <julien.grall@linaro.org>
xen/include/public/grant_table.h