[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen stable-4.2] x86/mm: fix checks against max_mapped_pfn
commit caa22c1e73b700eb9ac779f9e154f13d61e48c48 Author: Jan Beulich <jbeulich@xxxxxxxx> AuthorDate: Mon May 12 17:30:04 2014 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Mon May 12 17:30:04 2014 +0200 x86/mm: fix checks against max_mapped_pfn This value is an inclusive one, i.e. this fixes an off-by-one in memory sharing and an off-by-two in shadow code. Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx> Reviewed-by: Tim Deegan <tim@xxxxxxx> master commit: 088ee1d47b65d6bb92de61b404805f4ca92e3240 master date: 2014-04-03 12:08:43 +0100 --- xen/arch/x86/mm/mem_sharing.c | 4 ++-- xen/arch/x86/mm/shadow/common.c | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/xen/arch/x86/mm/mem_sharing.c b/xen/arch/x86/mm/mem_sharing.c index 5103285..09703a1 100644 --- a/xen/arch/x86/mm/mem_sharing.c +++ b/xen/arch/x86/mm/mem_sharing.c @@ -1266,8 +1266,8 @@ int relinquish_shared_pages(struct domain *d) return 0; p2m_lock(p2m); - for (gfn = p2m->next_shared_gfn_to_relinquish; - gfn < p2m->max_mapped_pfn; gfn++ ) + for ( gfn = p2m->next_shared_gfn_to_relinquish; + gfn <= p2m->max_mapped_pfn; gfn++ ) { p2m_access_t a; p2m_type_t t; diff --git a/xen/arch/x86/mm/shadow/common.c b/xen/arch/x86/mm/shadow/common.c index 1805018..0362c85 100644 --- a/xen/arch/x86/mm/shadow/common.c +++ b/xen/arch/x86/mm/shadow/common.c @@ -3604,9 +3604,7 @@ int shadow_track_dirty_vram(struct domain *d, struct sh_dirty_vram *dirty_vram = d->arch.hvm_domain.dirty_vram; struct p2m_domain *p2m = p2m_get_hostp2m(d); - if (end_pfn < begin_pfn - || begin_pfn > p2m->max_mapped_pfn - || end_pfn >= p2m->max_mapped_pfn) + if ( end_pfn < begin_pfn || end_pfn > p2m->max_mapped_pfn + 1 ) return -EINVAL; /* We perform p2m lookups, so lock the p2m upfront to avoid deadlock */ -- generated by git-patchbot for /home/xen/git/xen.git#stable-4.2 _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |