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=-7.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 12BA2C2BB84 for ; Wed, 16 Sep 2020 20:59:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B559E21D7D for ; Wed, 16 Sep 2020 20:59:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600289992; bh=mDQ6UTyuaB2u7tLV1Dk8pnrUM2PuADeCLe8cuMXZ8Vk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=O4bjWYkjEpkc4jhVTeS3FqsjL3X86NwdhRc2Z9oJT3thIi+6FF2KKpPtBMfBT8OvS TtuF6hTzk0ffllqIbkgeVRcOztt548FE0e1SywvwL2Ei0+PwhRAVfvq1kSaBY/fIKc enN5nSbLSHFaAtdmekgPOP0vTIas/SLLZFl+SXGA= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726631AbgIPU7j (ORCPT ); Wed, 16 Sep 2020 16:59:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:45640 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726378AbgIPQag (ORCPT ); Wed, 16 Sep 2020 12:30:36 -0400 Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id ED292222D9 for ; Wed, 16 Sep 2020 13:52:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600264365; bh=mDQ6UTyuaB2u7tLV1Dk8pnrUM2PuADeCLe8cuMXZ8Vk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=shzyBlLOTXJhv5uEUP9a13eFHZuifidHaD+0Pw/Hi7w8rSPCDS/1+xVICGYgHQO1t yWiuYXtowmBQWAofGCYH6UiS3gBJACYqp2KHBVBI+X+mu3S/hxBalizuzm6GbgirpV 7jH2jFQnS52R+Ljtb6AZnvYViY3zCuRFbinq4Hzc= Received: by mail-wr1-f47.google.com with SMTP id t10so7056302wrv.1 for ; Wed, 16 Sep 2020 06:52:44 -0700 (PDT) X-Gm-Message-State: AOAM532FhLTZgGcHsxK1LiY+EWTDFnbn8gkY8Z4YjoJhbUEoba3mbg3A 0Jg+LR1hUWYart1s85JmMZya8NwYSrvuF7oJFlzm5w== X-Google-Smtp-Source: ABdhPJxD/I3WhheFm3L0eJSqFjhj5WfUh9gRyFn04NLA/7Rn8UKNcJjJ0TVa6hRJJ0zHq7OYjPoH15YRyOrXg65QVEw= X-Received: by 2002:a5d:5111:: with SMTP id s17mr26717007wrt.70.1600264363439; Wed, 16 Sep 2020 06:52:43 -0700 (PDT) MIME-Version: 1.0 References: <086c73d8-9b06-f074-e315-9964eb666db9@intel.com> <4f2dfefc-b55e-bf73-f254-7d95f9c67e5c@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> In-Reply-To: From: Andy Lutomirski Date: Wed, 16 Sep 2020 06:52:31 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v11 25/25] x86/cet/shstk: Add arch_prctl functions for shadow stack To: Dave Hansen Cc: Andy Lutomirski , Yu-cheng Yu , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org 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. The question is: how much do we want to protect userspace from itself? --Andy