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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 628F9C4332F for ; Thu, 6 Oct 2022 03:12:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E15A6B0071; Wed, 5 Oct 2022 23:12:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9906D6B0073; Wed, 5 Oct 2022 23:12:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8312A8E0001; Wed, 5 Oct 2022 23:12:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 6EB736B0071 for ; Wed, 5 Oct 2022 23:12:02 -0400 (EDT) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 289A4AAAF8 for ; Thu, 6 Oct 2022 03:12:02 +0000 (UTC) X-FDA: 79989050484.15.9AA9B6C Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) by imf15.hostedemail.com (Postfix) with ESMTP id B09CFA001B for ; Thu, 6 Oct 2022 03:12:01 +0000 (UTC) Received: by mail-pl1-f174.google.com with SMTP id 10so606176pli.0 for ; Wed, 05 Oct 2022 20:12:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=92cDXfMM4fhpGyG1CdFkFFkRHBmwNUF9WdoS8N63zbk=; b=JkB8SMSgGV8yVHuEQZ5JreBh61vQzlqF9vphrCqkRS4EszqntGT3cIzSCks80i6m3B cRXYvfX21nQtqPLQ/h7usKRPeBEeTWxW4irpkI5+L4JEl4XqFyscURbUgbJazTQowD0p FD9SuXW9xf4u1dGJVH/mBg6gsBvHhbOAYpqmo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=92cDXfMM4fhpGyG1CdFkFFkRHBmwNUF9WdoS8N63zbk=; b=M4s6C5zOLf249gg5ysnU3TfqNFqTlmtziErkUu0CFqhObdTVkLuu8y55Dx9U51PYCc gwWGHek+nF/zzVNSrVILRWHq1Ll7JNZhMtwu8LfAAx6Ban/l5zXQcnnwAmTemNWZVRrl txKlg3nDDZx4i9MnQbjchNYF6GwX1ddqNXuN4hl4g31mjN/WfcODtE39rj61sfoZVRYC LXauHsgW6P9RnLn7O2zsG8xVL1zV2QdPe2QMyrCXJc2ubQs0mZUaGObyuCIEd23EPHLt ggH09kPtW4m1Ze14DUvvdWZGs4MkgJoKPuxTPjvQNtorM7xBR7uy0ghUqZo6Pp8umR5O I2JA== X-Gm-Message-State: ACrzQf02Ocw7w5W1Y3NDa+rgUnQEogFKeX7a+EaLvrrCm5B7mLgSMrDX JFIFMyGG+NMUkOlYIRcBCYtpqA== X-Google-Smtp-Source: AMsMyM4/A9tHmcS9DSMCnombql5Oosb8gPOdm0RsPlOyCIbfXteMbFXKhVWRv/a2FDuE51j+WjbkIw== X-Received: by 2002:a17:902:d4d2:b0:17a:a33:e334 with SMTP id o18-20020a170902d4d200b0017a0a33e334mr2522782plg.17.1665025920596; Wed, 05 Oct 2022 20:12:00 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q6-20020aa79606000000b0055fb19e27a8sm9261563pfg.121.2022.10.05.20.11.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Oct 2022 20:11:59 -0700 (PDT) Date: Wed, 5 Oct 2022 20:11:58 -0700 From: Kees Cook To: "Edgecombe, Rick P" Cc: "Lutomirski, Andy" , "bsingharora@gmail.com" , "hpa@zytor.com" , "Syromiatnikov, Eugene" , "peterz@infradead.org" , "rdunlap@infradead.org" , "dave.hansen@linux.intel.com" , "kirill.shutemov@linux.intel.com" , "Eranian, Stephane" , "linux-mm@kvack.org" , "fweimer@redhat.com" , "nadav.amit@gmail.com" , "jannh@google.com" , "dethoma@microsoft.com" , "kcc@google.com" , "linux-arch@vger.kernel.org" , "bp@alien8.de" , "oleg@redhat.com" , "hjl.tools@gmail.com" , "Yang, Weijiang" , "linux-doc@vger.kernel.org" , "pavel@ucw.cz" , "arnd@arndb.de" , "Moreira, Joao" , "tglx@linutronix.de" , "mike.kravetz@oracle.com" , "x86@kernel.org" , "jamorris@linux.microsoft.com" , "john.allen@amd.com" , "rppt@kernel.org" , "mingo@redhat.com" , "Shankar, Ravi V" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "linux-api@vger.kernel.org" , "gorcunov@gmail.com" Subject: Re: [PATCH v2 29/39] x86/cet/shstk: Support wrss for userspace Message-ID: <202210052011.C991E0B8C@keescook> References: <20220929222936.14584-1-rick.p.edgecombe@intel.com> <20220929222936.14584-30-rick.p.edgecombe@intel.com> <202210031525.78F3FA8@keescook> <6ea0841f-5086-9569-028b-922ec01a9196@kernel.org> <202210032129.44F6E027D@keescook> <33ee10b3d41bfa1f8cf03f87f1d13e565bea3120.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <33ee10b3d41bfa1f8cf03f87f1d13e565bea3120.camel@intel.com> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665025921; a=rsa-sha256; cv=none; b=x/w/7tDSuysesaaqP6o9VKG9i7lvrydxcyTikDkZIErOwqm3Us7BySHIdmbgwP+LR9wWXn sibENldtBsqkwXGmeBodHEun2JjEDsft1eqiaezinSyS5kQsCrfaNCamxGpwvxnwMXcBoW GFBE2A/Q4LRfMmeS/jbzdoSuTNtxMfM= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=JkB8SMSg; spf=pass (imf15.hostedemail.com: domain of keescook@chromium.org designates 209.85.214.174 as permitted sender) smtp.mailfrom=keescook@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665025921; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=92cDXfMM4fhpGyG1CdFkFFkRHBmwNUF9WdoS8N63zbk=; b=XJVUj2bD+uFmfJkDa5q1p4MPwvgK8dHkULV2QoHSTw4g51QeowKOzV+/YqKe2MybtUbe5P x3QbPXI/iZMTkfG6kymqTi5xp/hveQv7l2Wc29MAGCzzV00fVRDGPTzcPNmTnJ6N9qdMuo ci7TnWvt0i9fckG6UHAnZJSwFsa819M= X-Rspamd-Server: rspam08 X-Rspam-User: X-Rspamd-Queue-Id: B09CFA001B Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=JkB8SMSg; spf=pass (imf15.hostedemail.com: domain of keescook@chromium.org designates 209.85.214.174 as permitted sender) smtp.mailfrom=keescook@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Stat-Signature: butzzufg6e3cd61r6rrdmuw163igncbq X-HE-Tag: 1665025921-232353 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 Thu, Oct 06, 2022 at 12:38:06AM +0000, Edgecombe, Rick P wrote: > On Mon, 2022-10-03 at 21:37 -0700, Kees Cook wrote: > > On Mon, Oct 03, 2022 at 04:00:36PM -0700, Andy Lutomirski wrote: > > > On 10/3/22 15:28, Kees Cook wrote: > > > > On Thu, Sep 29, 2022 at 03:29:26PM -0700, Rick Edgecombe wrote: > > > > > For the current shadow stack implementation, shadow stacks > > > > > contents easily > > > > > be arbitrarily provisioned with data. > > > > > > > > I can't parse this sentence. > > > > > > > > > This property helps apps protect > > > > > themselves better, but also restricts any potential apps that > > > > > may want to > > > > > do exotic things at the expense of a little security. > > > > > > > > Is anything using this right now? Wouldn't thing be safer without > > > > WRSS? > > > > (Why can't we skip this patch?) > > > > > > > > > > So that people don't write programs that need either (shstk off) or > > > (shstk > > > on and WRSS on) and crash or otherwise fail on kernels that support > > > shstk > > > but don't support WRSS, perhaps? > > > > Right, yes. I meant more "what programs currently need WRSS to > > operate > > under shstk? (And what is it that they are doing that needs it?)" > > > > All is see currently is compiler self-tests and emulators using it? > > > https://codesearch.debian.net/search?q=%5Cb%28wrss%7CWRSS%29%5Cb&literal=0&perpkg=1 > > Most apps that weren't just automatically compiled haven't had > implementation effort yet. (of course glibc has had a bunch) I hope we > would see more of that when we finally get it upstream. So I think a > better question is, how many apps will need WRSS when they go to enable > shadow stack. I'm thinking the answer must be some and it could be nice > to catch them when they first investigate enabling it. > > But yes, except for Mike's CRIU branch, there aren't any programs that > use it today, and we could drop it for a first implementation. I don't > see it as something that would only make things less safe though. It > just lets apps that can't easily work within the stricter shadow stack > environment, at least get access to a weaker but still beneficial one. > > Kees, did you catch that it can be locked off while enabling shadow > stack? Yup, saw that! Looks good. Thanks. :) -- Kees Cook