Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2279282ybk; Sun, 17 May 2020 16:11:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCWmhiwAScuZ4zJeMMSMZBKm6Wm5+PG0gcxrEWYSW2BF5iCgqsifJg5d0/Y2yTbD6cRQmr X-Received: by 2002:a50:bb07:: with SMTP id y7mr11050014ede.176.1589757094781; Sun, 17 May 2020 16:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589757094; cv=none; d=google.com; s=arc-20160816; b=w1rFjDiad0qbyDkwgrTMVruJMJWC5gdstKVtR1cBr9P5yQ2qX+ZQoDbEjfQy2M/16o 4TvzlulWe7QD+k8QpP48KcQ8+WZaQiHpMt1jLefXX1oPeVxkL1RmRAKQb8PV2EwSPCoS Hv5YXahufPxqlJLRVH5YmgyRHg5ckEAlF7LXlS2KHrwKFbCjoMXdUzSIyQvazcju4L53 1oswuTgIQRJvtnnjgTrLfQWZDTTnWFs/ftD0nQK9s0lTfsc7kOo3AeMDAB9H1BIJZmfD ees46Eck9JTeQVocNM98ucVHFmJfhzA6nwyOTp21FQ6WLY5y+/p9Ne66RkGiiCUQeqy5 3DKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:ironport-sdr :ironport-sdr; bh=WAFkth0gYc8H9wwFkwGs2uaP3qmNuOjXo61cuCnoihs=; b=yMEkaOByGLWgRWdhx94hqSewej/sBNqxnMtCcaoRRFWm+R1rQkQJtenmm7a4IfOKYV mLQp87hiE9D93D/OP22geLZ4C8raouY71J42N7jHTptxd0QAtXhlOAhbHMEFsOHbqnaB 0L3yFXl5BCgjsgJwc+vrjXbhOjCm6/xh4J/1vAhzx81Z4+nLkAEC5CdP0yr2iK85vxla O9F/YK1jfkJjTbCgwOTu9mtqOIZYCLgeH8o6hljtAJqQ7m9ohpKuIyJqvZ0fUp1Idmun Na5XGvgZ+tm7ahMGsjr891Zs/muuQPpjbyoLeb7zwM11n7IaU6+8zw6/P8o/uSxSElwQ UYMQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rs20si6050512ejb.76.2020.05.17.16.11.07; Sun, 17 May 2020 16:11:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726695AbgEQXJn (ORCPT + 99 others); Sun, 17 May 2020 19:09:43 -0400 Received: from mga17.intel.com ([192.55.52.151]:12248 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726602AbgEQXJn (ORCPT ); Sun, 17 May 2020 19:09:43 -0400 IronPort-SDR: rkOizmf2WkOxbIWfMkrKYE/cERUBJ8IGysdW9jNsE8IQ4SJR5E+yvPOAMIsIgzdoVI3NzPPt8s /h3TZYGj2m+g== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 May 2020 16:09:41 -0700 IronPort-SDR: gCVe4So+096STFqAezdl4R4+rr2jqb4qLxzal6pc/LsPrQYcUmATafaieBSjybEqE0BCpVm3CD Q/az5OnPIzSA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,405,1583222400"; d="scan'208";a="267335907" Received: from gprestbx-mobl.amr.corp.intel.com (HELO [10.254.67.37]) ([10.254.67.37]) by orsmga006.jf.intel.com with ESMTP; 17 May 2020 16:09:40 -0700 Subject: Re: [PATCH v10 01/26] Documentation/x86: Add CET description To: "H.J. Lu" Cc: Yu-cheng Yu , the arch/x86 maintainers , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang References: <20200429220732.31602-1-yu-cheng.yu@intel.com> <20200429220732.31602-2-yu-cheng.yu@intel.com> <5cc163ff9058d1b27778e5f0a016c88a3b1a1598.camel@intel.com> <44c055342bda4fb4730703f987ae35195d1d0c38.camel@intel.com> <32235ffc-6e6c-fb3d-80c4-a0478e2d0e0f@intel.com> <631f071c-c755-a818-6a97-b333eb1fe21c@intel.com> From: Dave Hansen Autocrypt: addr=dave.hansen@intel.com; keydata= xsFNBE6HMP0BEADIMA3XYkQfF3dwHlj58Yjsc4E5y5G67cfbt8dvaUq2fx1lR0K9h1bOI6fC oAiUXvGAOxPDsB/P6UEOISPpLl5IuYsSwAeZGkdQ5g6m1xq7AlDJQZddhr/1DC/nMVa/2BoY 2UnKuZuSBu7lgOE193+7Uks3416N2hTkyKUSNkduyoZ9F5twiBhxPJwPtn/wnch6n5RsoXsb ygOEDxLEsSk/7eyFycjE+btUtAWZtx+HseyaGfqkZK0Z9bT1lsaHecmB203xShwCPT49Blxz VOab8668QpaEOdLGhtvrVYVK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dIPdIPIlfEPiAWcg5BtLQU4Wg3cNQdpWrCJ1E3m/RIlXy/2Y3YOVVohfSy+4kvvYU3 lXUdPb04UPw4VWwjcVZPg7cgR7Izion61bGHqVqURgSALt2yvHl7cr68NYoFkzbNsGsye9ft M9ozM23JSgMkRylPSXTeh5JIK9pz2+etco3AfLCKtaRVysjvpysukmWMTrx8QnI5Nn5MOlJj 1Ov4/50JY9pXzgIDVSrgy6LYSMc4vKZ3QfCY7ipLRORyalFDF3j5AGCMRENJjHPD6O7bl3Xo 4DzMID+8eucbXxKiNEbs21IqBZbbKdY1GkcEGTE7AnkA3Y6YB7I/j9mQ3hCgm5muJuhM/2Fr OPsw5tV/LmQ5GXH0JQ/TZXWygyRFyyI2FqNTx4WHqUn3yFj8rwTAU1tluRUYyeLy0ayUlKBH ybj0N71vWO936MqP6haFERzuPAIpxj2ezwu0xb1GjTk4ynna6h5GjnKgdfOWoRtoWndMZxbA z5cecg== Message-ID: <042a0b0e-bbf0-53d7-91b2-ea113ca8cca5@intel.com> Date: Sun, 17 May 2020 16:09:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/15/20 7:51 PM, H.J. Lu wrote: > On Fri, May 15, 2020 at 4:56 PM Dave Hansen wrote: >> Let's say we have an app doing silly things like retpolines. (Lots of >> app do lots of silly things). It gets compiled in a distro but never >> runs on a system with CET. The app gets run for the first time on a >> system with CET. App goes boom. Not init, just some random app, say >> /usr/bin/ldapsearch. > > I designed and implemented CET toolchain and run-time in such a way > for it very difficult to happen. Basically, CET won't be enabled on such > an app. Would you care to share any specifics about how this is implemented? That would be great information to include in the kernel documentation because it informs us about the reasons why we don't need a kernel-based "kill switch". >> What's my recourse as an end user? I want to run my app and turn off >> CET for that app. How can I do that? > > The CET OS I designed turns CET off for you and you don't have to do > anything. OK, cool! Could you share some of the specifics about how it does that? >> Is it possible with the patches in this series to run a single- >> threaded binary which was has GNU_PROPERTY_X86_FEATURE_1_SHSTK >> unset to run with shadow stack protection? > > Yes, you can. I added such capabilities for testing purpose. But > you application will crash as soon as there is a CET violation. My > CET software design is very flexible. Yu-cheng speficially referred to the: GLIBC_TUNABLES=glibc.tune.hwcaps=-SHSTK,-IBT option. Is that the option you're talking about? >>> I have a quick test that checks shadow stack and ibt in both main program and in >>> signals. Currently it is public on Github. If that is desired, I can submit it >>> to the mailing list. >> >> Yes, that is desired. It must accompany this submission. It must also >> exercise all of the new ABIs. > > Our CET smoke test is for quick validation of CET OS, not just > kernel. It requires the complete CET implementation. It does > nothing if your OS isn't CET enabled. I think requiring the complete CET implementation to be present for this test to work is a mistake. We don't require anything other than an enabled kernel and the selftests that ship with that kernel. MPX required toolchain, library and compiler changes. Yet, we had a totally standalone kernel test that found real bugs. It sounds like this smoke test as it stands wouldn't be a great fit. But, that shouldn't discourage us from finding something that _is_ a good fit for the kernel-shipped selftests.