[PATCH 07/12] libxenguest: fix off-by-1 in colo-secondary-bitmap merging

Jan Beulich posted 12 patches 4 years, 7 months ago
There is a newer version of this series
[PATCH 07/12] libxenguest: fix off-by-1 in colo-secondary-bitmap merging
Posted by Jan Beulich 4 years, 7 months ago
Valid GFNs (having a representation in the dirty bitmap) need to be
strictly below p2m_size.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/tools/libs/guest/xg_sr_save.c
+++ b/tools/libs/guest/xg_sr_save.c
@@ -614,7 +614,7 @@ static int colo_merge_secondary_dirty_bi
     for ( i = 0; i < count; i++ )
     {
         pfn = pfns[i];
-        if ( pfn > ctx->save.p2m_size )
+        if ( pfn >= ctx->save.p2m_size )
         {
             PERROR("Invalid pfn 0x%" PRIx64, pfn);
             rc = -1;


Re: [PATCH 07/12] libxenguest: fix off-by-1 in colo-secondary-bitmap merging
Posted by Andrew Cooper 4 years, 7 months ago
On 25/06/2021 14:20, Jan Beulich wrote:
> Valid GFNs (having a representation in the dirty bitmap) need to be
> strictly below p2m_size.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>