Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp671626pxk; Wed, 16 Sep 2020 14:01:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk878E9sVMzoakDA0sJKsTXJCSJvH7wvyl4B7ubq5F37xLEdraRGLc6DvOxiw/EGYw5sZH X-Received: by 2002:a17:906:17c6:: with SMTP id u6mr28016703eje.95.1600290081648; Wed, 16 Sep 2020 14:01:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600290081; cv=none; d=google.com; s=arc-20160816; b=J0W+KHEyDx+3jEJ3Mkpk86oGnrttBMCsKQ9ZNSkwgZYtj41jBsqv15F7u6f1fuk7Ko z82Iil+dwFfZN8juuEiNN/swiLbxt7Ei4BftQQUXXw0ze4CJewYdHjain/KqtlU8kDvo rW3ET8M8p7+27XgXBdsWEUD6u3XQTmolb4x8nnsKnaiqdXsTPGgfZ1vVUlsvgSzUepMh //dLEI/9k4MLKLkfLViZSjtHU7tcRu6rvMWNFM3Mvw2KJoEpIqQGNjzkJK+RVcoTbBwG HUogDSL2igKeivUa6/0THzUL2qy0rZia4Eu9aj49d+ijI4w2CYI4t/nk1cflB51Bxkau bZvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=p8WyZy11Jx9qTZUvjR02j80ydNUE3mjOJr5EuZ6Ofpg=; b=Enz3oUCy/bp+XpJu3l9SV1FKFIBz85lF4ZWtPqhRL3Y8t+MXf07ry+Yu2qiVU4loGR LirAcnOF8zY7mA+n/U3zX+/7U+Me7Kkq/h+pj7VOqSaXUumI/OrkrtjIXTVKZq0KC7jP df508r33n68dDz/YsRPWM19WZbeGyKeO/XeoWSlKtnVk6sXZA1t4Cmn/vXs+fFObFurs gKYJJOGWlpUS4O5DrPF1einhpCNv+Xtua0tg6ueGItprkmxEBqUIdrR4zc+K7M9DhJSH +NKjlmkdMor5e5ZQtqL4P+TQKSkd+ZkDiuKTTABh0bN1RnXo4k/HI/wagFFwlF+A6AZl Et8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=shzyBlLO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u15si12432905ejx.239.2020.09.16.14.00.58; Wed, 16 Sep 2020 14:01:21 -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; dkim=pass header.i=@kernel.org header.s=default header.b=shzyBlLO; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726236AbgIPU74 (ORCPT + 99 others); Wed, 16 Sep 2020 16:59:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43612 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726322AbgIPQag (ORCPT ); Wed, 16 Sep 2020 12:30:36 -0400 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 F1DD3222E7 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-f48.google.com with SMTP id k15so7004745wrn.10 for ; Wed, 16 Sep 2020 06:52:44 -0700 (PDT) X-Gm-Message-State: AOAM530YW+pXpmvhpOsvUhCxDO70Ubk0bC2ewQnh712IjKX2IIMlp79r b5UI2aAzoT0AGYsJgW7MUHPcyynDP2XwdpF7NJ6XzQ== 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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