Received: by 10.192.165.148 with SMTP id m20csp357791imm; Wed, 2 May 2018 01:16:56 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrstptAz22v9qbzR2yz63JQFbBPY1JJi+EyfssLRX0NxcHjE0EtTZaNiCJoDyNucb3jaou6 X-Received: by 2002:a17:902:758d:: with SMTP id j13-v6mr19283018pll.188.1525249016597; Wed, 02 May 2018 01:16:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525249016; cv=none; d=google.com; s=arc-20160816; b=0fSKgvECD3fAACZouVR2r5c3VZd3HarU0RLfSt0Gv/HMmb/oZHG7BGFz6ECnATKyP4 hUVX7ZeHzSQtDxWNk92eFlcjK3p1w1YYz4bpFrQ36D1RZudZKrJlx4Wq0c9LN+CYhsPH OdNL/JyWqldCM1vzp/hrlDe9w9d/v9vSXNz623kY4qB6eJmyTBl1WEnnYFFW2+ibANxQ fqPduYneLEjWklQnsryuXnH/8plhqHu3H3zv+4to1xlJKiDdUHGM0KeSl9swP76kxm3A iJI8NTMy/YZWksTE1vqy5P+Sv8G4FM1JaU1WJOLfhbtBt/pD9vhaeOc2uu4F3IZizaTE gHzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:in-reply-to:references :subject:cc:to:from:date:message-id:arc-authentication-results; bh=fp5atlUzASM/FpoakrN6YNUEF7wgRgHyiMLu29t6W70=; b=FDfJ9ovsiGwjWiPAjx66kkNCAj4IPMiED1BivzVclXYCY7TX9tAisKnwGhzoBnmUIQ nXOWwlqUfj0bllsK+IdKvnqrjfFlHPncpMrUd+HWaxLfZGk87ETIx5Sap0euKcQjmHpm 6wMRxP6nnuLsAfNgBAnyTUn9XS7WuY832muLz1v1zrNAglwab5xg7Ab+3KTUAfjJK27E WPW+VgufrS/clGSrraO6jJb0EzmR+6p2/52TmkD8BESe8xqyJXV1sb1m7nJENZ8hmjQF bhd7pVSY7J1xpOvsbEChLG1ccXS1v2l5JbsZwual1obC0vbtxlgmsmGKeS+fjyKc9CEN Wv7w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j84si10953206pfk.203.2018.05.02.01.16.41; Wed, 02 May 2018 01:16:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751354AbeEBIQZ convert rfc822-to-8bit (ORCPT + 99 others); Wed, 2 May 2018 04:16:25 -0400 Received: from prv1-mh.provo.novell.com ([137.65.248.33]:42734 "EHLO prv1-mh.provo.novell.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbeEBIQW (ORCPT ); Wed, 2 May 2018 04:16:22 -0400 Received: from INET-PRV1-MTA by prv1-mh.provo.novell.com with Novell_GroupWise; Wed, 02 May 2018 02:16:22 -0600 Message-Id: <5AE973CD02000078001C008E@prv1-mh.provo.novell.com> X-Mailer: Novell GroupWise Internet Agent 18.0.0 Date: Wed, 02 May 2018 02:16:13 -0600 From: "Jan Beulich" To: "Boris Ostrovsky" Cc: "xen-devel" , "Juergen Gross" , , Subject: Re: [Xen-devel] [PATCH 3/4] xen/PVH: Set up GS segment for stack canary References: <20180430162339.17143-1-boris.ostrovsky@oracle.com> <20180430162339.17143-4-boris.ostrovsky@oracle.com> In-Reply-To: <20180430162339.17143-4-boris.ostrovsky@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> On 30.04.18 at 18:23, wrote: > --- a/arch/x86/xen/xen-pvh.S > +++ b/arch/x86/xen/xen-pvh.S > @@ -54,6 +54,9 @@ > * charge of setting up it's own stack, GDT and IDT. > */ > > +#define PVH_GDT_ENTRY_CANARY 4 > +#define PVH_CANARY_SEL (PVH_GDT_ENTRY_CANARY * 8) I can only advise against doing it this way: There's no safeguard against someone changing asm/segment.h without changing this value (in fact this applies to all of the GDT selectors populated in this file). At the very least tie this to GDT_ENTRY_BOOT_TSS / __BOOT_TSS? > @@ -64,6 +67,9 @@ ENTRY(pvh_start_xen) > mov %eax,%es > mov %eax,%ss > > + mov $(PVH_CANARY_SEL),%eax > + mov %eax,%gs > + > /* Stash hvm_start_info. */ > mov $_pa(pvh_start_info), %edi > mov %ebx, %esi > @@ -150,6 +156,7 @@ gdt_start: > .quad 0x00cf9a000000ffff /* __BOOT_CS */ > #endif > .quad 0x00cf92000000ffff /* __BOOT_DS */ > + .quad 0x0040900000000018 /* PVH_CANARY_SEL */ Without any further code before loading the selector, this points at physical address 0. Don't you need to add in the base address of the per-CPU stack_canary? Jan