The grant ABI uses 64 bit values, and allows a PV guest to specify linear
addresses. There is nothing interesting a 32bit PV guest can reference which
will pass an __addr_ok() check (and therefore succeed), but we should still
explicitly check and reject such an attempt.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
}
else
{
+ /* Guest trying to pass an out-of-range linear address? */
+ if ( is_pv_32bit_domain(currd) && addr != (uint32_t)addr )
+ goto out;
+
pl1e = map_guest_l1e(addr, &gl1mfn);
if ( !pl1e )
}
else
{
+ if ( is_pv_32bit_domain(currd) )
+ {
+ if ( addr != (uint32_t)addr )
+ {
+ ASSERT_UNREACHABLE();
+ goto out;
+ }
+
+ /* Guest trying to pass an out-of-range linear address? */
+ if ( new_addr != (uint32_t)new_addr )
+ goto out;
+ }
+
if ( new_addr && !steal_linear_address(new_addr, &nl1e) )
goto out;