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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C5BFC4321E for ; Sat, 3 Dec 2022 02:53:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235088AbiLCCxF (ORCPT ); Fri, 2 Dec 2022 21:53:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235152AbiLCCxE (ORCPT ); Fri, 2 Dec 2022 21:53:04 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B7492A414 for ; Fri, 2 Dec 2022 18:53:01 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id 136so5875424pga.1 for ; Fri, 02 Dec 2022 18:53:01 -0800 (PST) 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:message-id:reply-to; bh=IdsbvopHdpWN4t4Xyy6LXgHJs384GWwdgMIM91slJ/E=; b=XT2jmzsk2Vfm9w+DkN1Lz1Tjy71qjWPoao8qtRj3bZrZPfwXB1hyqIpn57pvB90/rq 63d7fOq2Mmf1kO+vR788ukxfPlAiT1KSgQZg9/z58zWQ7i9nFvKwjhfZPugl3zobOmso EN1WafQcrekEIywXwOWjLrHS2LNPk4WBZLGxc= 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 :message-id:reply-to; bh=IdsbvopHdpWN4t4Xyy6LXgHJs384GWwdgMIM91slJ/E=; b=EBca7FbNJShLzi6jC1hkJoMRWVvrz72zkfIVBUgF4FIBER6Ceb4nPytBja1NvVHV/S uhecAT1OcQ1bJ2TOGPrkI7fPKF/SnF7JdQozmI/D7qbZoq3Izoch+TuVXkltfpUP2Xt1 tlcpdqA3l25F/Q8oceaOlD1S6YGt1mPWBIexU72ZgLIeJv+sFOdZ499Wxl15f013om1h BRJ5BgpOEac2xsNnPvqvud4+XdXlJvBtGFqw3aD9Z/bcdIsRyG2IStWgZ2lpeMQik4if Fa8sU2le/TPG4dxEu0zawReZrKsied/Eff6tyJvY3yGb/VxfTrkPJGFQA9LjyKkkSS1X 9oLQ== X-Gm-Message-State: ANoB5pldPtQng/HEqVtNpDORB/yNPCGlJIpESSRP1XPr73JqBkv9b/it GGqM7OPzMvUhl3RgBbuuSK9DoQ== X-Google-Smtp-Source: AA0mqf6LVB3GIyJWeUGBPXDf0PbRYROGSN6hS1j62oC6woS8D14mopgLVA3lzwvQcDRjfAOqKPjecA== X-Received: by 2002:a05:6a00:1f10:b0:573:578b:e773 with SMTP id be16-20020a056a001f1000b00573578be773mr58396836pfb.11.1670035980821; Fri, 02 Dec 2022 18:53:00 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id i20-20020a170902e49400b00168dadc7354sm6231569ple.78.2022.12.02.18.53.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 18:53:00 -0800 (PST) Date: Fri, 2 Dec 2022 18:52:59 -0800 From: Kees Cook To: Rick Edgecombe Cc: x86@kernel.org, "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Borislav Petkov , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H . J . Lu" , Jann Horn , Jonathan Corbet , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , Weijiang Yang , "Kirill A . Shutemov" , John Allen , kcc@google.com, eranian@google.com, rppt@kernel.org, jamorris@linux.microsoft.com, dethoma@microsoft.com, akpm@linux-foundation.org, Andrew.Cooper3@citrix.com, christina.schimpe@intel.com Subject: Re: [PATCH v4 32/39] x86: Expose thread features in /proc/$PID/status Message-ID: <202212021852.0EC80A46@keescook> References: <20221203003606.6838-1-rick.p.edgecombe@intel.com> <20221203003606.6838-33-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221203003606.6838-33-rick.p.edgecombe@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Fri, Dec 02, 2022 at 04:35:59PM -0800, Rick Edgecombe wrote: > Applications and loaders can have logic to decide whether to enable > shadow stack. They usually don't report whether shadow stack has been > enabled or not, so there is no way to verify whether an application > actually is protected by shadow stack. > > Add two lines in /proc/$PID/status to report enabled and locked features. > > Since, this involves referring to arch specific defines in asm/prctl.h, > implement an arch breakout to emit the feature lines. > > Tested-by: Pengfei Xu > Tested-by: John Allen > Signed-off-by: Kirill A. Shutemov Reviewed-by: Kees Cook -- Kees Cook