Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1432192ybl; Thu, 5 Dec 2019 01:05:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxNcn0kwgXclTCCuQQR1FZU/+Y1pfcYLniLODT84LrO08w8B5xgrglZrcwIYlhCQ7i7q29H X-Received: by 2002:a05:6830:120c:: with SMTP id r12mr5952733otp.327.1575536714917; Thu, 05 Dec 2019 01:05:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575536714; cv=none; d=google.com; s=arc-20160816; b=oe4SNhgtp6eGkM3MiKWCp22m0NrdIqAXhbabnvNsBa5YShNgovPAHLwKAxencEsjMw e0MVA3FrzjTZpDYppDdGN2hwfpmTfr2HU52Yw1tzLrI7TUtXfH5j1pm1JIwNR0QUJppW 2XiOleW/FszKcb1C0FOP0ply+jXGZPEtmIeyTYKAAXD1YdfLMVxpMOds2RGF/owopXSo 4vJWwpLLnFOSChWAdfSyZ/G1gCOgOvQS8hjRLiOv5iSXh7HNQctibLgn11hBaZUsyO3M t8zNMeFWCni3WP8QvpKUEjs0yxd3JFTUa7o1Amn1GEQt96eES3k7NCQTxdVnWFFdfgO3 sCsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=aSbWk7EeCpOIeMzv9/xkKVRKopCYH4/eSh8m9jVb3vY=; b=tuih7Ecx0pYIngKH/CXkEi6Sg/GGNgOKXVkvpAOV9VIUTqt3hkjV2UVFvaH9SGwqak XH29Xd5hud42coWuXml07a3UZwwJr87okPW+caCNw/GF3dbEqIos1WBAerkfNp0uYSpo yb32bAy2QSPAMDxNRqIPxrnjwj9Dyf5mZ7mD5H7OpIyEk3vgSqIpJX+V9Lh3bHZHEFB/ 7Xvl38pYiIRbhFY+FfBkbbx8i1/CzmtE5gAsWVT/bttVsqvdat8IokhOnfNUPityq7l4 csgOz6nn2kdNxyR5aXs6Y06sb8ad/r6FeqcKuOUC4QAkc1C3XbfE3aURpKRBusOxsNH/ iODQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=VHHTxYpi; 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 f4si4524471oto.169.2019.12.05.01.05.01; Thu, 05 Dec 2019 01:05:14 -0800 (PST) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=VHHTxYpi; 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 S1728985AbfLEJEX (ORCPT + 99 others); Thu, 5 Dec 2019 04:04:23 -0500 Received: from merlin.infradead.org ([205.233.59.134]:40642 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726096AbfLEJEX (ORCPT ); Thu, 5 Dec 2019 04:04:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=aSbWk7EeCpOIeMzv9/xkKVRKopCYH4/eSh8m9jVb3vY=; b=VHHTxYpiYZAEz9i8xE12I6Rb8 rgRS896TtuujzBoN2nFGRRV80ROgK1VDafD7m9/MAsRTSce8r0gfFktZBwJmEnKyq6D+tCWB/wVFx ZduZOvp4x2W3Ytsh78jUHn0Zheprqm3szyYMITL1QBoNZoAVRBS/UXCM9KPSlcnqcEFE1L1VfxExE yB4/cvW5V3ZfdKypG1dUuA+kSZCCWWakLAGT6jY01pXUBUthu/hifAGswK0VBo20KtmCJoIWg7sun IXy5t0EsACo31AywxBKddaahDD60GwZNH9yGvvtWmG1PP5Ut+XajXe2SGt4BUVgG0XgxX4ZaEbQUH 8vuS3Q5NA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1icn3G-00022y-SN; Thu, 05 Dec 2019 09:03:59 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id BA244303150; Thu, 5 Dec 2019 10:02:38 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id E1FAE20B8E996; Thu, 5 Dec 2019 10:03:55 +0100 (CET) Date: Thu, 5 Dec 2019 10:03:55 +0100 From: Peter Zijlstra To: Thomas Garnier Cc: kernel-hardening@lists.openwall.com, kristen@linux.intel.com, keescook@chromium.org, Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v10 04/11] x86/entry/64: Adapt assembly for PIE support Message-ID: <20191205090355.GC2810@hirez.programming.kicks-ass.net> References: <20191205000957.112719-1-thgarnie@chromium.org> <20191205000957.112719-5-thgarnie@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191205000957.112719-5-thgarnie@chromium.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 04, 2019 at 04:09:41PM -0800, Thomas Garnier wrote: > @@ -1625,7 +1627,11 @@ first_nmi: > addq $8, (%rsp) /* Fix up RSP */ > pushfq /* RFLAGS */ > pushq $__KERNEL_CS /* CS */ > - pushq $1f /* RIP */ > + pushq $0 /* Future return address */ We're building an IRET frame, the IRET frame does not have a 'future return address' field. > + pushq %rdx /* Save RAX */ fail.. > + leaq 1f(%rip), %rdx /* RIP */ nonsensical comment > + movq %rdx, 8(%rsp) /* Put 1f on return address */ > + popq %rdx /* Restore RAX */ fail.. > iretq /* continues at repeat_nmi below */ > UNWIND_HINT_IRET_REGS > 1: > -- > 2.24.0.393.g34dc348eaf-goog >