gnttab: fix out of range shift count

Commit 213f145114 ("gnttab: fix/adjust gnttab_transfer()") wasn't
careful enough in this regard.

Coverity ID: 1306859
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Jan Beulich committed 2015-07-07 10:28:25 +02:00
1 parent b9dbe33d15
commit 6d6e2997fb
1 file changed
+2 -1
+2 -1
View File
@@ -1829,7 +1829,8 @@ gnttab_transfer(
max_bitsize = domain_clamp_alloc_bitsize(
e, e->grant_table->gt_version > 1 || paging_mode_translate(e)
? BITS_PER_LONG + PAGE_SHIFT : 32 + PAGE_SHIFT);
if ( (1UL << (max_bitsize - PAGE_SHIFT)) <= mfn )
if ( max_bitsize < BITS_PER_LONG + PAGE_SHIFT &&
(mfn >> (max_bitsize - PAGE_SHIFT)) )
{
struct page_info *new_page;
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.