Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5325314rdb; Wed, 13 Dec 2023 05:49:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFC5+ppGAEjJjnWb4dr4R2DQIsL2loIBcmWUjcD0ItYG/wDOhqNsgeZTLXOuNtvcvA1oKAc X-Received: by 2002:a17:902:e5cd:b0:1cf:cd31:6b85 with SMTP id u13-20020a170902e5cd00b001cfcd316b85mr8438437plf.27.1702475390335; Wed, 13 Dec 2023 05:49:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702475390; cv=none; d=google.com; s=arc-20160816; b=E3pojGzBHStTMdd6z6qzMXhKo6eBEkj8kSzaDMFLAsTbrA5aoY5jnLi7ZFnfJLDj/W Nt9czll85yO5N9SOBtZRKU9P2Vds2pIuaCS0OwrAgn1QM8b+T9Z2FqZ/zacPk0V+jRRc 9uB6t+fbprM5LkmGum/PFRu1BgPpDu998/WC7IfzLuh2ExD2CDQPCuqkBAnYuVYaI0Bs w+0TLjFY+eL2MihOfRy7mTeMCeggnChmQhV88F2Uno2QGTdnEuq6weryYQFub1iTuQyg BBuRmhIXndzsBzlQDP/3tVoc2eUoqYhIsui9REkydQ9424fYW0E5c5bZ6dH9Vv0g8WZm 4bOA== 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=PNyFI2Mpc1WdMv+09T1SXKvFizOb61KSv71WhxqWz8E=; fh=vWZ0xdkht5Ihl2G3lmTKxZOty+iux+Yg2f3WTT7Ff9w=; b=cCWIdyURHIbRx1ry7bGf9hUzpw1GdUyTv+DdeAY+Q6Mewnqm8ReAzNL1rq9dxZyuLA sABn1R2bE7yH4p3h6VsUX+8G8vfZXfuZXwo5idfocueC0slJ09VbsZasvUL9pkV9l6g9 9q6cKb/3PRbBd15P+mAeUn0WbYOAxx2Gp7pKJ1bh4qyaAQ8dI0UAhzDf5oAf+7Yd7jOn iVtM/Mxfe0cq5oRsFML68gbaCj6TuI5Fqhl6RuGXL64ou5H1QGpZ3fJpYebZOlutyMY2 teWgpmPYlcfavz+wXWDNdJOUgaqAXbh5ji7FCdScHeBCjqXLAR9sd1s8od4EYoEnODjd C19Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nLSW8zDA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id be9-20020a170902aa0900b001cfc9a1915bsi9467267plb.234.2023.12.13.05.49.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 05:49:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nLSW8zDA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id DB65780B8F31; Wed, 13 Dec 2023 05:49:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378970AbjLMNte (ORCPT + 99 others); Wed, 13 Dec 2023 08:49:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233509AbjLMNtc (ORCPT ); Wed, 13 Dec 2023 08:49:32 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 896D695 for ; Wed, 13 Dec 2023 05:49:39 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 98E3DC433C7; Wed, 13 Dec 2023 13:49:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702475379; bh=PNyFI2Mpc1WdMv+09T1SXKvFizOb61KSv71WhxqWz8E=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nLSW8zDANEVNHFOtFyXlOB9m7Pc9xIeqUMFJpaJNXgyoNhBzVXEUk9opATfsy2oal wRbvuaumSqLUIa+NMSBfO/LMqX+4nSqtiio6HenhDMeGFWGnlOGELna0yPd2Irl9jO 5+MI5ynunAofTV7goPnqKF6+f5L1czOZ3ExA4GV3magiQkQIzKd9jyffRnP+4b5kBK L2N4V+xJ0pzQoB6JF+Kvtcj0gx7onTfczeFs6gwWM5KCfQlYS1P8nC+RSzSIx8HneL n7gwwtiX2MyG0bZYK6tkUUbfvV2ZJ+bZjgfm0jVXpQDKqS+WyK+6MqdutTajzX6ecw /B7NAIrU16Nng== Date: Wed, 13 Dec 2023 13:49:29 +0000 From: Mark Brown To: "Edgecombe, Rick P" Cc: "linux-arch@vger.kernel.org" , "suzuki.poulose@arm.com" , "Szabolcs.Nagy@arm.com" , "linux-fsdevel@vger.kernel.org" , "linux-riscv@lists.infradead.org" , "catalin.marinas@arm.com" , "corbet@lwn.net" , "linux-kernel@vger.kernel.org" , "kvmarm@lists.linux.dev" , "oliver.upton@linux.dev" , "palmer@dabbelt.com" , "debug@rivosinc.com" , "aou@eecs.berkeley.edu" , "rppt@kernel.org" , "shuah@kernel.org" , "arnd@arndb.de" , "maz@kernel.org" , "oleg@redhat.com" , "fweimer@redhat.com" , "keescook@chromium.org" , "james.morse@arm.com" , "ebiederm@xmission.com" , "brauner@kernel.org" , "will@kernel.org" , "thiago.bauermann@linaro.org" , "hjl.tools@gmail.com" , "linux-kselftest@vger.kernel.org" , "paul.walmsley@sifive.com" , "ardb@kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mm@kvack.org" , "akpm@linux-foundation.org" , "linux-doc@vger.kernel.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> <28c584ff-ef25-464f-852c-c5ddf66e5906@sirena.org.uk> <4acb51ebb3764f6a48a741d7b7d33f9a68c996fb.camel@intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+/nsIWnogzOjsOHn" Content-Disposition: inline In-Reply-To: <4acb51ebb3764f6a48a741d7b7d33f9a68c996fb.camel@intel.com> X-Cookie: One size fits all. 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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 13 Dec 2023 05:49:48 -0800 (PST) --+/nsIWnogzOjsOHn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Dec 12, 2023 at 09:22:59PM +0000, Edgecombe, Rick P wrote: > On Tue, 2023-12-12 at 20:26 +0000, Mark Brown wrote: > > In general if things have a need to get at prctl()s via ptrace we > > should > > just fix that, at least for arm64 there's things like the vector > > lengths > > that are currently controlled via prctl(), but it shouldn't be a > > blocker > > for the locking specifically. > ptrace arch_prctl() is a bit odd. Not all values of 'option' are > supported because ptrace arch_prctl's have to operate cross task. Some > have extra code to support doing this, and some only know how to > operate on the current task, so return an error in the ptrace case. It feels like x86 is doing some things via arch_prctl() rather than implementing specific ptrace() interfaces for them, there's a lot of stuff where ptrace isn't a great fit for due to it's concept that it's going to work with an array of registers so that's understandable. > I guess a benefit would be that there could be some arch agnostic > ptrace userspace code. And I'd also guess (really a guess) that most > ptracing code has some arch awareness already, but the other way is > probably non-zero. Same for shadow stack enabling code. Then on the > kernel side we'd have to add and support a ptrace prctl() solution. > Is it worth the effort? I don't have a strong opinion. I don't have a strong enough opinion on it to start working on it immediately at any rate. --+/nsIWnogzOjsOHn Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmV5tmgACgkQJNaLcl1U h9CAhAf8CQEZOdWDIY7Wox4T7BzkaUfw/3Fa/4lTqu0TQ31mrybSqq9IHseTshgc Mn6pJLAuHfPGj1iDEGxc3ukqVD/LgxFzMPoA18ZkdIrRLEAxoeKcq1vvJLfl6zws GnWoqPcVdY1adnKNGo57jhoeE9pO71+2lfqK4yndK/BjR+iSo/PWM91Ub9SN2EbF /czeqjpXV+eRF11RAEHmYsx/Uwz3ibAIE9vc0Yn8X9x+EEJhRZ1op3afAqK/Jn5I X3sM+uRaDnWAb3KJ0C460J8jgjFuukww2GPdAFCp9HOQSXRYxKp4BfkxcAcAS9mL xBHVT6Pa6B/vaeTYas4nGzUoUcaukA== =4csw -----END PGP SIGNATURE----- --+/nsIWnogzOjsOHn--