gnttab: don't silently truncate GFNs in compat setup-table handling

Returning back truncated frame numbers is unhelpful: Quite likely
they're not owned by the domain (if it's PV), or we may misguide the
guest into writing grant entries into a page that it actually uses for
other purposes.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
This commit is contained in:
Jan Beulich committed 2022-12-05 13:44:50 +01:00
1 parent 3ea18e9e26
commit 1043dfb165
1 file changed
+6 -1
+6 -1
View File
@@ -176,7 +176,12 @@ int compat_grant_table_op(
{ \
for ( i = 0; i < (_s_)->nr_frames; ++i ) \
{ \
unsigned int frame = (_s_)->frame_list.p[i]; \
compat_pfn_t frame = (_s_)->frame_list.p[i]; \
if ( frame != (_s_)->frame_list.p[i] ) \
{ \
(_s_)->status = GNTST_address_too_big; \
break; \
} \
if ( __copy_to_compat_offset((_d_)->frame_list, \
i, &frame, 1) ) \
{ \
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.