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 C2C9EC4321E for ; Sat, 3 Dec 2022 02:42:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235082AbiLCCm0 (ORCPT ); Fri, 2 Dec 2022 21:42:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234490AbiLCCmZ (ORCPT ); Fri, 2 Dec 2022 21:42:25 -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 C986EFB886 for ; Fri, 2 Dec 2022 18:42:24 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id r18so5828673pgr.12 for ; Fri, 02 Dec 2022 18:42:24 -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=meefZluJRT8R1ZjwlCgxWmtfD4FhrgL7NrJdXoDBmDg=; b=MTgb8KAwPwhviwDCMgXJisTzBHivsq3T5iFl2j3sa72GQLKq316gETtxR6MxReMlP9 OScIiVPvewVlAKwI9xxH1OoS70ozLjqj7rE3Yi6ELTKGwnUKk0manJYTzF7OpY/IWbYM YP28xqv0zglEeg8XLHPqcThJxDDXme/w/AILc= 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=meefZluJRT8R1ZjwlCgxWmtfD4FhrgL7NrJdXoDBmDg=; b=O/ZZrQg2Z05+iv7GoYiM5FPl3W6bf7elj1uWlWif259DPNGW53N+MSr1bM6FhCW3ar CsnwPgsvtBN8VVvK8BZecSZcpvd6uEUUtdUxmCPU6SWduiC5HUc9cLi1TfXhLf10eLkp beBe38PK9ImcLfU6JJ45F7R+0e7RiS8bLwneIe8ho5Zpd9YYa/j2jotjbuxLZFJs203k HnNJVqX06cSliPkJFTz4v7BiL0aC3hJ5yvbVwtPpXii/CAcKHEdT60BULorq+AyTJhjY mDhx3ax4dhgykpbAlbTVD+S8P/8Mgc69cJkPoikwTBJqxeCIrFI+gqqg1IVw7Fcs2uSv IRZg== X-Gm-Message-State: ANoB5plb8umV30Deuw7tmwt55ssmF8gD/rqnE8zviZgDok/FYX5hFZIx RH66e4qDASOUehKdTIsL7kJGrw== X-Google-Smtp-Source: AA0mqf6nBAfJOSwwSZ437KK8J11H4vJ/7I2F5AOtpkwNBwwS77nrLl03wK13FIkg0xoppkHEZVitag== X-Received: by 2002:a65:4c48:0:b0:478:24b4:1a7e with SMTP id l8-20020a654c48000000b0047824b41a7emr23581417pgr.516.1670035343071; Fri, 02 Dec 2022 18:42:23 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id o13-20020a17090a0a0d00b0021896fa945asm7230803pjo.15.2022.12.02.18.42.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 18:42:22 -0800 (PST) Date: Fri, 2 Dec 2022 18:42:21 -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 25/39] x86: Introduce userspace API for shadow stack Message-ID: <202212021842.28A81923A@keescook> References: <20221203003606.6838-1-rick.p.edgecombe@intel.com> <20221203003606.6838-26-rick.p.edgecombe@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221203003606.6838-26-rick.p.edgecombe@intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Fri, Dec 02, 2022 at 04:35:52PM -0800, Rick Edgecombe wrote: > From: "Kirill A. Shutemov" > > Add three new arch_prctl() handles: > > - ARCH_SHSTK_ENABLE/DISABLE enables or disables the specified > feature. Returns 0 on success or an error. > > - ARCH_SHSTK_LOCK prevents future disabling or enabling of the > specified feature. Returns 0 on success or an error > > The features are handled per-thread and inherited over fork(2)/clone(2), > but reset on exec(). > > This is preparation patch. It does not implement any features. > > Tested-by: Pengfei Xu > Tested-by: John Allen > Signed-off-by: Kirill A. Shutemov Reviewed-by: Kees Cook -- Kees Cook