From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B7F11C433E2 for ; Wed, 16 Sep 2020 19:25:18 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 290AE20838 for ; Wed, 16 Sep 2020 19:25:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 290AE20838 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6E4FC90000E; Wed, 16 Sep 2020 15:25:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6BC6B900007; Wed, 16 Sep 2020 15:25:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D28190000E; Wed, 16 Sep 2020 15:25:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 4825D900007 for ; Wed, 16 Sep 2020 15:25:17 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id F352B8249980 for ; Wed, 16 Sep 2020 19:25:16 +0000 (UTC) X-FDA: 77269903074.11.nerve81_27171a12711c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id BCCEC180F8B81 for ; Wed, 16 Sep 2020 19:25:16 +0000 (UTC) X-HE-Tag: nerve81_27171a12711c X-Filterd-Recvd-Size: 5103 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Sep 2020 19:25:15 +0000 (UTC) IronPort-SDR: qC5KJiuy1XgFuRn4nu9XuFRUc9Z/ieQhIBqbPRvtQva/KYxcAt3GC3NFtokbq8t0O7uxw6qDJm fOS0v8VnMj5Q== X-IronPort-AV: E=McAfee;i="6000,8403,9746"; a="159604365" X-IronPort-AV: E=Sophos;i="5.76,434,1592895600"; d="scan'208";a="159604365" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2020 12:25:13 -0700 IronPort-SDR: eg/Zchq5mOXDbpxpZFJ33RXMAD8TeVG7Z6YeVuuDo5eZiEwZNocXGb+rGVRDmIBihv4mUFVhg8 Lk6TY0hQd4LA== X-IronPort-AV: E=Sophos;i="5.76,434,1592895600"; d="scan'208";a="451983016" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.212.184.15]) ([10.212.184.15]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2020 12:25:12 -0700 From: "Yu, Yu-cheng" Subject: Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for shadow stack To: Andy Lutomirski , Dave Hansen Cc: Dave Martin , "H.J. Lu" , Florian Weimer , X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , "open list:DOCUMENTATION" , Linux-MM , linux-arch , Linux API , Arnd Bergmann , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Weijiang Yang References: <086c73d8-9b06-f074-e315-9964eb666db9@intel.com> <20200901102758.GY6642@arm.com> <32005d57-e51a-7c7f-4e86-612c2ff067f3@intel.com> <46dffdfd-92f8-0f05-6164-945f217b0958@intel.com> <6e1e22a5-1b7f-2783-351e-c8ed2d4893b8@intel.com> <5979c58d-a6e3-d14d-df92-72cdeb97298d@intel.com> <08c91835-8486-9da5-a7d1-75e716fc5d36@intel.com> <41aa5e8f-ad88-2934-6d10-6a78fcbe019b@intel.com> Message-ID: <35af3052-324f-06e3-5092-ac6d435f1725@intel.com> Date: Wed, 16 Sep 2020 12:25:11 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: BCCEC180F8B81 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 9/16/2020 6:52 AM, Andy Lutomirski wrote: > On Mon, Sep 14, 2020 at 2:14 PM Dave Hansen wrote: >> >> On 9/14/20 11:31 AM, Andy Lutomirski wrote: >>> No matter what we do, the effects of calling vfork() are going to be a >>> bit odd with SHSTK enabled. I suppose we could disallow this, but >>> that seems likely to cause its own issues. >> >> What's odd about it? If you're a vfork()'d child, you can't touch the >> stack at all, right? If you do, you or your parent will probably die a >> horrible death. >> > > An evil program could vfork(), have the child do a bunch of returns > and a bunch of calls, and exit. The net effect would be to change the > parent's shadow stack contents. In a sufficiently strict model, this > is potentially problematic. When a vfork child returns, its parent's shadow stack pointer is where it was before the child starts. To move the shadow stack pointer and re-use the content left by the child, the parent needs to use CALL, RET, INCSSP, or RSTORSSP. This seems to be difficult. > > The question is: how much do we want to protect userspace from itself? > If any issue comes up, people can always find ways to counter it. > --Andy >