[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 08/13] libxenguest: fix off-by-1 in colo-secondary-bitmap merging


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 5 Jul 2021 17:15:21 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CH+Vf0mOEcNpv8wC1iMww0i4+CIzDv1HfwE6AQaKUlM=; b=Z7D5VTzHQlg8KoaEEOq9sTaRRFaglMGjeEOIwRq4+dX1haM9xxNCX3UtKLvnl3N5a5T2ZfmhKKdrD+8LIzYq7WzvtsPj3YUz3TfGBL6EpJaOxeX2YcluTbxuike8UCgOh6NrzYQow+/jB7rb5HkkOtss1pHIYM4JfzGZr0Lv08uhKpdr58M5zlzF/GYProBHrM1B9Iq+B/9r7mhM7K4Cx4WnCOx3qJnkiMHBH02/nKArQwKWJsL3mW4QgWuxgPll1jSW1CZBr41nmbmoJl1e9CratXGiQmHSVa3Nm5H2WWg7BSnq+pp/YodM/h/UQZfFFGxsPxaJXUnS2IuVCVAK+A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Q+X9X469BWmqonNoftMG0qjNl92QLYKGScOC5CzdOqslCYtkfc7X3VsiPaBUYALQJ5BZyegXlgnKvB5jm4tA+Z6yCBwVmopd5T6DMuBYvX+8phnRtNaeeefutLPU0BXXKK2Rcx3/lLCO+tb3JIQ0NvGfrqqljpDNBrulc0ZLH64gTNlzuR4E/NNRMmQL6BXsO9HdI81YnQOe6Oh0qxTl2yc4KFkGxblZ+q02a6lGlgdsD2ze4IgbTY3AmzCYCf0f2eKS+iDPfcep0IyIe03KJztssJnjZZgTBGZ8MA8InIesOkcVbtPV8Y/wXO6cegv9cf0Eq8IdWSvIlFTZezg4XQ==
  • Authentication-results: xenproject.org; dkim=none (message not signed) header.d=none;xenproject.org; dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Mon, 05 Jul 2021 15:15:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Valid GFNs (having a representation in the dirty bitmap) need to be
strictly below p2m_size.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

--- 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;




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.