mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
Fix a bug in shadow_remove_all_access_in_page.
Fixes a fairly obvious bug, in which an if statement was reversed. The bug has been present for a while, so apparently this code isn't well tested. Signed-off-by: Michael Vrable <mvrable@cs.ucsd.edu>
This commit is contained in:
1 parent
af94cd2a06
commit
d9ce2a8e73
2 files changed
+22
-22
No files matched your search
+11
-11
@@ -2214,7 +2214,7 @@ static u32 remove_all_access_in_page(
|
||||
struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
|
||||
{
|
||||
l1_pgentry_t *pl1e = map_domain_page(l1mfn);
|
||||
l1_pgentry_t match;
|
||||
l1_pgentry_t match, ol2e;
|
||||
unsigned long flags = _PAGE_PRESENT;
|
||||
int i;
|
||||
u32 count = 0;
|
||||
@@ -2226,17 +2226,17 @@ static u32 remove_all_access_in_page(
|
||||
|
||||
for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
|
||||
{
|
||||
if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
|
||||
{
|
||||
l1_pgentry_t ol2e = pl1e[i];
|
||||
pl1e[i] = l1e_empty();
|
||||
count++;
|
||||
if ( l1e_has_changed(pl1e[i], match, flags) )
|
||||
continue;
|
||||
|
||||
if ( is_l1_shadow )
|
||||
shadow_put_page_from_l1e(ol2e, d);
|
||||
else /* must be an hl2 page */
|
||||
put_page(&frame_table[forbidden_gmfn]);
|
||||
}
|
||||
ol2e = pl1e[i];
|
||||
pl1e[i] = l1e_empty();
|
||||
count++;
|
||||
|
||||
if ( is_l1_shadow )
|
||||
shadow_put_page_from_l1e(ol2e, d);
|
||||
else /* must be an hl2 page */
|
||||
put_page(&frame_table[forbidden_gmfn]);
|
||||
}
|
||||
|
||||
unmap_domain_page(pl1e);
|
||||
|
||||
@@ -1622,7 +1622,7 @@ static u32 remove_all_access_in_page(
|
||||
struct domain *d, unsigned long l1mfn, unsigned long forbidden_gmfn)
|
||||
{
|
||||
l1_pgentry_t *pl1e = map_domain_page(l1mfn);
|
||||
l1_pgentry_t match;
|
||||
l1_pgentry_t match, ol2e;
|
||||
unsigned long flags = _PAGE_PRESENT;
|
||||
int i;
|
||||
u32 count = 0;
|
||||
@@ -1634,17 +1634,17 @@ static u32 remove_all_access_in_page(
|
||||
|
||||
for (i = 0; i < L1_PAGETABLE_ENTRIES; i++)
|
||||
{
|
||||
if ( unlikely(!l1e_has_changed(pl1e[i], match, flags) == 0) )
|
||||
{
|
||||
l1_pgentry_t ol2e = pl1e[i];
|
||||
pl1e[i] = l1e_empty();
|
||||
count++;
|
||||
if ( l1e_has_changed(pl1e[i], match, flags) )
|
||||
continue;
|
||||
|
||||
if ( is_l1_shadow )
|
||||
shadow_put_page_from_l1e(ol2e, d);
|
||||
else /* must be an hl2 page */
|
||||
put_page(&frame_table[forbidden_gmfn]);
|
||||
}
|
||||
ol2e = pl1e[i];
|
||||
pl1e[i] = l1e_empty();
|
||||
count++;
|
||||
|
||||
if ( is_l1_shadow )
|
||||
shadow_put_page_from_l1e(ol2e, d);
|
||||
else /* must be an hl2 page */
|
||||
put_page(&frame_table[forbidden_gmfn]);
|
||||
}
|
||||
|
||||
unmap_domain_page(pl1e);
|
||||
|
||||