Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4865909rdb; Tue, 12 Dec 2023 11:23:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJfupAK6MG3Ff1IiHu7hclF49zjLot+aCC5Mdvj8QCsK7AFdXNSg7vx+IWL23XbK1jd2dV X-Received: by 2002:a17:90b:5109:b0:28a:3110:93a9 with SMTP id sc9-20020a17090b510900b0028a311093a9mr3184378pjb.86.1702409020116; Tue, 12 Dec 2023 11:23:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702409020; cv=none; d=google.com; s=arc-20160816; b=Ksh18N9l6HPCWRkgQPSbh3iJ/aliyonFpSbehDagwF6AdM261MUOZAvg+A+Wrp7vNW m2AdpU19y4hplf/42/A6dPTrX6JNYqkDxh/WJzwPDEBwKV7/VwFUIW9xWD7FsKUTZIOq EexpZCiB5cOxNhGw0Xh0ckbR0gtcpQ+e88uJztf8d3QiW5Ffaj4sFtrPuWi+xTwc8Tr3 bszfibPst4PlAfq2IJxGyw7MEA5GSo6ZcgwqoohBqo+Wy1c8CJ/tzpEDuSwrx1R1QT62 1mNjU7e3JBNicR44fC/rP14eUz2aRDKFaLX8pn/j9N8hJbXkCb90Q34yrxCa4C1SCWiO 9l+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=jw9QHr72LewT87Hl30VMuOFkHPJSNXOCUXV8vmy31GM=; fh=TqIALBV+Tmb9k/Zsv4pmxeoKpbOidJWOboBFUCRDhig=; b=lwnCZDfUIPDxpNAtvBqwSiOhh4rEvVJ1xKrRW6CtMSK75OzRR8J+3YW3y2r+c8aZb0 pDxDTao1f2RqKS6zgKjROxUSCDQ/qUDNOlbJ8FjnajqluLaKmtMZ6RPVwgEWkIbfcy5s POKDBDc5INoUHAAruiJqMDjXkgzmeZgCvvwCAZRJdCL4GmOB9V6Wz8gg2uCZY5ZxEuvo s+WYqnJ/Jhs7GcLYUwNrO70ehkUbXzsPz5zBIXyYodN9a/NiD3SJZAgNOSFvRXS64guN oqIG/nuaJGh0GFt7+/4hJdfmET4q10xJ2qluMxZOQ1Mws5xc16RLaNQ94oRlvnpf/9iG My+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IfP7DhS6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id ls7-20020a17090b350700b002810ae70420si1112727pjb.121.2023.12.12.11.23.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 11:23:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IfP7DhS6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id F127B80EFC7C; Tue, 12 Dec 2023 11:23:36 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235049AbjLLTXX (ORCPT + 99 others); Tue, 12 Dec 2023 14:23:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233299AbjLLTXV (ORCPT ); Tue, 12 Dec 2023 14:23:21 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6223EF3 for ; Tue, 12 Dec 2023 11:23:27 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2ED42C433C7; Tue, 12 Dec 2023 19:23:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702409007; bh=XugEc5jga7y4PNlRm8BjKTZfUw+pu3ZxkmQIpRIWEZY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IfP7DhS6GQRIPh94PCnUY3D3v9HTUhNBLMgvDIKCSEyZWm7on3QEnlPSEsrB8VAly VxMqSbIZ3bDXLEwsbe1kcsiYY+66gJUk3MPujLh2TLd7piiYzNgT8/mby6PZXl45hv sWza2pUfxy/BGubgyV4ylzDtq0PT2Kjxb2j3/tZYOAyFsmOn3MVP+RVMO0+OJ63ELh 8RieySJS8ocPfrZvxa9x9m8fK3pWdefGd7urdXdt3BI/iUUyl4yaoAxKMVxifEh29R ScXKjFti5r284zeeNNlTXHDNkVr0M/tfj7cm/QDJyTpxq4jSK3MjR/isfYySuemepR TnR15vPgid9eA== Date: Tue, 12 Dec 2023 19:22:24 +0000 From: Mark Brown To: Deepak Gupta Cc: Catalin Marinas , Will Deacon , Jonathan Corbet , Andrew Morton , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Arnd Bergmann , Oleg Nesterov , Eric Biederman , Kees Cook , Shuah Khan , "Rick P. Edgecombe" , Ard Biesheuvel , Szabolcs Nagy , "H.J. Lu" , Paul Walmsley , Palmer Dabbelt , Albert Ou , Florian Weimer , Christian Brauner , Thiago Jung Bauermann , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, kvmarm@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: Re: [PATCH v7 02/39] prctl: arch-agnostic prctl for shadow stack Message-ID: References: <20231122-arm64-gcs-v7-0-201c483bd775@kernel.org> <20231122-arm64-gcs-v7-2-201c483bd775@kernel.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="sqzR9iJQv0rAi7An" Content-Disposition: inline In-Reply-To: X-Cookie: If rash develops, discontinue use. X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 12 Dec 2023 11:23:37 -0800 (PST) --sqzR9iJQv0rAi7An Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 12, 2023 at 11:17:11AM -0800, Deepak Gupta wrote: > On Wed, Nov 22, 2023 at 1:43=E2=80=AFAM Mark Brown w= rote: > > +/* > > + * Set the current shadow stack configuration. Enabling the shadow > > + * stack will cause a shadow stack to be allocated for the thread. > > + */ > > +#define PR_SET_SHADOW_STACK_STATUS 72 > > +# define PR_SHADOW_STACK_ENABLE (1UL << 0) > Other architecture may require disabling shadow stack if glibc > tunables is set to permissive mode. > In permissive mode, if glibc encounters `dlopen` on an object which > doesn't support shadow stack, > glibc should be able to issue PR_SHADOW_STACK_DISABLE. > Architectures can choose to implement or not but I think arch agnostic > code should enumerate this. The current implementation for arm64 and therefore API for the prctl() is that whatever combination of flags is specified will be set, this means that setting the status to something that does not include _ENABLE will result in disabling and we don't need a separate flag for disable. We have use cases that make active use of disabling at runtime. Please delete unneeded context from replies, it makes it much easier to find new content. --sqzR9iJQv0rAi7An Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmV4svAACgkQJNaLcl1U h9Btqwf/bsYteQozf7cPtwIIhQRSI8MqfxjmscBVibOnKEFjdEqlRLo5JjkO6Pr6 Hsm1uhj0HkH+VoTgU/3/1losf+mnWyaEoeE90IUq5vBweWShWNPKbMowY1s1JyJT eJ8Jv5z8xL0Zd92fTtAv0/Gl/nzqAWu3nWwc0eQH9GFutxYJ/RQceRg37XE/DJ7Z odJHFuONGqU0YzuzvzYXPwCScKSOq3ym2wrT5xOjARR2ltJqsKxN2gVDflKZzP62 UImi4UsGqWZ2QvQb/fIh6ch/i9mPYGPi81vtynCHbAn91TWcPAvgOCA1Sywzc2p0 32BmmvfZZxpi8FaPWip8qJ7NDQKaeA== =sM8B -----END PGP SIGNATURE----- --sqzR9iJQv0rAi7An--