From: Ian Campbell Subject: Re: [PATCH 4.1-testing] x86/mm: Fix loop increment in paging_log_dirty_range() Date: Thu, 17 Jan 2013 11:39:52 +0000 Message-ID: <1358422792.13856.51.camel@zakaz.uk.xensource.com> References: <20130114121924.GA65620@ocelot.phlegethon.org> <04368044ca5fb9800bfd.1358422212@whitby.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <04368044ca5fb9800bfd.1358422212@whitby.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Tim Deegan Cc: Steven Noonan , Jan Beulich , Matt Wilson , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Thu, 2013-01-17 at 11:30 +0000, Tim Deegan wrote: > # HG changeset patch > # User Tim Deegan > # Date 1358421452 0 > # Node ID 04368044ca5fb9800bfdacf14e883d39cad5c8a6 > # Parent 8fe0e86c2ac27e22121aa9c70ddf5eacbb3051d0 > x86/mm: Fix loop increment in paging_log_dirty_range() > > In 23417:53ef1f35a0f8 (the fix for XSA-27 / CVE-2012-5511), the > loop variable gets incremented twice, so the loop only clears every > second page of the bitmap. This might cause the tools to think that > pages are dirty when they are not. > > Reported-by: Steven Noonan > Reported-by: Matt Wilson > Signed-off-by: Tim Deegan Acked-by: Ian Campbell > diff -r 8fe0e86c2ac2 -r 04368044ca5f xen/arch/x86/mm/paging.c > --- a/xen/arch/x86/mm/paging.c Wed Jan 16 14:15:12 2013 +0000 > +++ b/xen/arch/x86/mm/paging.c Thu Jan 17 11:17:32 2013 +0000 > @@ -534,7 +534,8 @@ int paging_log_dirty_range(struct domain > > size = ((nr + BITS_PER_LONG - 1) / BITS_PER_LONG) * sizeof (long); > rv = 0; > - for ( off = 0; !rv && off < size; off += sizeof zeroes ) > + off = 0; > + while ( !rv && off < size ) > { > int todo = min(size - off, (int) PAGE_SIZE); > if ( copy_to_guest_offset(dirty_bitmap, off, zeroes, todo) ) > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel