Received: by 10.192.165.148 with SMTP id m20csp3967657imm; Mon, 30 Apr 2018 09:22:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoqk893/RemPLVNviuLqARPbBGKyGEJQ1PLfxVTeAqkAaalDLbexbqfboleOwj53XdcYtnx X-Received: by 2002:a17:902:3f83:: with SMTP id a3-v6mr13084860pld.279.1525105353769; Mon, 30 Apr 2018 09:22:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525105353; cv=none; d=google.com; s=arc-20160816; b=VHPNNvo94wIds9i8Xr9uYGvyG4hjEad+2Z4Lr+rDGcss6kYdvTC+M8HbkPfM06yyYi 1waYnur+bl24RauplepoC95R6zDh1feLnrFFZ5Mwx59eRwNxkv/N7mB3Sy46AwbKsAyJ 8i1Mu4aceOPBKyyewLG6kT5a5TvmxinkhRvuDg0049Ke3P5odbqPeMIk3W26mhVJAa2b 66Ix2bD/vK/ZWkwceqf8FSxrmLq0u6yDbxfVInyp9NqaL0s5gGXBHOguSIzfn8JNCdwQ vpDcgnB2hxkzuJIguDAJsfNC1fxRbmCmhSQ66HT+qN9mDu+B8AW0plPOEfDfzaLRe2lp NYoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=BSLahkNdAGl01HEnmSDPGaGhcluTe6yZtcFicTra358=; b=HQWKQA0JUlcx/oAE6ZEB7OlqprcyVgGC+iy/dRIbXUFaq1q1L8tZTJJDMeordQn2wT SzFh4gCHL8pfcBCnyO3NkZxMcDLzgicwPs0ao0BBOIEL+OYRo+YjgpydIPBnQsQ6/9HL 5yzeaDYuyDRuFGn6z1ZS6oKPSfj+eR7c3PffxAPuJuJ99Z9mmcw2McxEjQcH3hvBVJt0 TS5yNOGMPXs6YDfqBBj754guBUuyPTZ/MYtIpnasiwLoo6oxlZtn4pNVO+xMbvC8nQnJ AEhyTn8/3KXTrRALpWNAH7gkIB7GYWJ0WNKtq9QNF55j5XpWCRtQSlDIqwarDUWpL4ke SJTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=SjkQnfdd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q14-v6si7342184pll.542.2018.04.30.09.22.19; Mon, 30 Apr 2018 09:22:33 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=SjkQnfdd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754928AbeD3QVn (ORCPT + 99 others); Mon, 30 Apr 2018 12:21:43 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:49144 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754557AbeD3QVk (ORCPT ); Mon, 30 Apr 2018 12:21:40 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w3UGKj6n123330; Mon, 30 Apr 2018 16:21:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2017-10-26; bh=BSLahkNdAGl01HEnmSDPGaGhcluTe6yZtcFicTra358=; b=SjkQnfddUi6u7nFNHIknWXXrpazyLa9eC9Msu++zXrJjZ/V9ZXISnIv2B2DkIjNa7MyG Y5SyCZC2sYzUHHR0OpMjediTlT9SWIb9cADxW2XkJL2NcNntUtKyRz99vihp8nMIG+rk XZue2fCC8ahfTMg0WFWwNRRht4MKFSbKQDdeopoHOhXcTumYQO+CjHbFuwAumz5NXzC4 9jguRKKlRTvGlj+gukuhUBWo60r/8MBNSQESVeo+l79ciEOTvHqaFxnm47gKAyxEGRzE 5YefgeHpmMjcsKUH0PGF60MO+9WKoTVkiZKc2suQvM0xCtRUmV2QKRTe6h6FIkPPvSYA Jw== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2hmgdjcu8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Apr 2018 16:21:36 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w3UGLZdD008471 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Apr 2018 16:21:36 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3UGLZ7V010105; Mon, 30 Apr 2018 16:21:35 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com.com (/10.152.32.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 30 Apr 2018 09:21:35 -0700 From: Boris Ostrovsky To: linux-kernel@vger.kernel.org, xen-devel@lists.xenproject.org Cc: jgross@suse.com, Boris Ostrovsky , stable@vger.kernel.org Subject: [PATCH 3/4] xen/PVH: Set up GS segment for stack canary Date: Mon, 30 Apr 2018 12:23:38 -0400 Message-Id: <20180430162339.17143-4-boris.ostrovsky@oracle.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180430162339.17143-1-boris.ostrovsky@oracle.com> References: <20180430162339.17143-1-boris.ostrovsky@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8879 signatures=668698 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=880 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1804300156 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are making calls to C code (e.g. xen_prepare_pvh()) which may use stack canary (stored in GS segment). Signed-off-by: Boris Ostrovsky Cc: stable@vger.kernel.org --- arch/x86/xen/xen-pvh.S | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/x86/xen/xen-pvh.S b/arch/x86/xen/xen-pvh.S index 373fef0..4eed586 100644 --- 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) + ENTRY(pvh_start_xen) cld @@ -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 */ gdt_end: .balign 4 -- 2.9.3