[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 07/12] libxenguest: fix off-by-1 in colo-secondary-bitmap merging
- To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Fri, 25 Jun 2021 15:20:43 +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=dvKtEXrYuF/DSgjrdaM5MapZ8LS8e8Zco99pDWWMsA4=; b=PFo+5meOm4Sv4mh7wBmEGf71hOSaN4Ohxn1v4QFwI/bXv+CJVaB/JvPdm1PI2lFFsv+AdeOkO6YdXWhNe6Z50hjBNPUC5SOKM4povXMCHDs+AKnJlx0Si7Y5MSk1WUKj0SXh/1uGDP5fIfEhSGWlOrJ12DV8mwgvQpbkWPn88ueiHVn4fLcXi/xmDqfsFJDUtyXZ8hoj/a9MrPdz/YkmioFAD8qw29G6im+gvZ65tUk6ZUsGb3WCTaJpoEJtD1H7a8suFjsJiURATt2L5xxBNvWgj9u8F5oLRPARxKcH+D/pakPkFpQxGmHzPCfbfW/4/zUtJuB+FLsGS/A2ihiP0Q==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ni/JXLQdRCsYcOxDYex6MwWXkC+IifuACj6K27FusDd9SNwfX48oKUBtnds2IwnHXH07mGA/oy+EBL9nkBT1SM8K9QKZW2IJ1KuDtXTRxjqtS33uGNDYQ55WrAIsSzZoM24uLdWtSwzpbxOQXSNaOnCXenq3i7AVyLJJbcxh8qWCzOigIS6jpVfHB0OGJse4vE3x2dcky/VVroVmwMytsB3AvG0uD4QyrCUORGzcBFm8ahsD1mspDcl4P5dTgKI8JdiDrB+C5XQjOeJUiCdc7mYzwhSEzS/LN+eJSjUc0fgNXQ8+zJUfwN5QcjEHUDDZKR7NHB/sOd7ssBGP7b8r9g==
- 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: Fri, 25 Jun 2021 13:20:56 +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>
--- 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;
|