From: Juergen Gross Subject: [PATCH] don't put dom0 console info directly after start_info data Date: Fri, 19 Jun 2015 13:06:53 +0200 Message-ID: <1434712013-31328-1-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Z5u8Q-00056l-Ge for xen-devel@lists.xenproject.org; Fri, 19 Jun 2015 11:06:58 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xenproject.org, jbeulich@suse.com, keir@xen.org, andrew.cooper3@citrix.com Cc: Juergen Gross List-Id: xen-devel@lists.xenproject.org The console information of dom0 is living in the same memory page as the start_info data. Don't put the console data directly after the start_info to leave some room for future structure enlargements. Otherwise a dom0 with a newer start_info layout than the hypervisor could interprete console data as part of the start_info data. Before commit 50bd1f0825339dfacde471df7664729216fc46e3 there used to be a padding at the end of start_info, but this was removed as it was regarded to be not necessary. Signed-off-by: Juergen Gross --- xen/arch/x86/domain_build.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen/arch/x86/domain_build.c b/xen/arch/x86/domain_build.c index d76707f..065406b 100644 --- a/xen/arch/x86/domain_build.c +++ b/xen/arch/x86/domain_build.c @@ -1462,9 +1462,11 @@ int __init construct_dom0( if ( cmdline != NULL ) strlcpy((char *)si->cmd_line, cmdline, sizeof(si->cmd_line)); - if ( fill_console_start_info((void *)(si + 1)) ) + if ( fill_console_start_info((void *)si + PAGE_SIZE - + sizeof(struct dom0_vga_console_info)) ) { - si->console.dom0.info_off = sizeof(struct start_info); + si->console.dom0.info_off = + PAGE_SIZE - sizeof(struct dom0_vga_console_info); si->console.dom0.info_size = sizeof(struct dom0_vga_console_info); } -- 2.1.4