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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EB6EFC433EF for ; Thu, 3 Mar 2022 10:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=58l58Yh7GQX7xtJ/r8MjsjITfTN3tXvX7CqrqRHcYjo=; b=Zo3KK0nXlg90YV nTVi9cuA4A7b9am90LeHCeST35lkuxA1j7Cr9ZdI/uxEu05Kb290rReGjISxong94BJXdMSPube2a vyC9OBWgM0EiUhEPFgbvi+O1L5AmnwW4x7WPAFK5tniLLeZseDPLEjNzTYP3uwi7Dc66HE85Ezcgd VF9G06zJ1BUvMaP03r+EvJPddD56VgorCbV+4E0A6YkS8sEtG/7f6fV5vpJ51zJwOr316/1jwZnyJ HUr0lxmP8GlB36jlMoO7AnAQY4medM/lTSWlK9tq+FM3QSeBIwFqWZetKBUJHGX0ulKxXojhAir6B O3E2YxOieD/NDV3jNRiQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPinG-0065A4-Js; Thu, 03 Mar 2022 10:34:46 +0000 Received: from ams.source.kernel.org ([145.40.68.75]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nPinC-00659g-2d for linux-arm-kernel@lists.infradead.org; Thu, 03 Mar 2022 10:34:44 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 93F7AB824B4; Thu, 3 Mar 2022 10:34:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEAC2C004E1; Thu, 3 Mar 2022 10:34:37 +0000 (UTC) Date: Thu, 3 Mar 2022 10:34:34 +0000 From: Catalin Marinas To: Evgenii Stepanov Cc: Mark Brown , Will Deacon , Joey Gouly , Branislav Rankov , Linux ARM Subject: Re: [PATCH v1 4/4] arm64/mte: Add userspace interface for enabling asymmetric mode Message-ID: References: <20220127195712.748150-1-broonie@kernel.org> <20220127195712.748150-5-broonie@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220303_023442_317731_91F519DF X-CRM114-Status: GOOD ( 27.93 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Mar 02, 2022 at 12:58:48PM -0800, Evgenii Stepanov wrote: > On Wed, Mar 2, 2022 at 11:33 AM Mark Brown wrote: > > On Wed, Mar 02, 2022 at 10:44:31AM -0800, Evgenii Stepanov wrote: > > > On Wed, Mar 2, 2022 at 5:10 AM Mark Brown wrote: > > > > On Wed, Mar 02, 2022 at 11:44:53AM +0000, Catalin Marinas wrote: > > > > > On Tue, Mar 01, 2022 at 04:52:01PM -0800, Evgenii Stepanov wrote: > > > > > > > > Extending PR_MTE_TCF_MASK seems bad for backward compatibility. User > > > > > > code may do "flags =& ~PR_MTE_TCF_MASK" to disable MTE; when compiled > > > > > > against an old version of the header this would fail to remove the ASYMM > > > > > > bit. > > > > > > > But if the app is compiled against an old version, it wouldn't set > > > > > MTE_CTRL_TCF_ASYMM either as it doesn't have the definition. > > > > > Libraries within a single process can be built against different > > > header versions. In our case, this is libc vs the app: we expect to > > > set all 3 mode bits when an app asks for "async" to enable the > > > mte_tcf_preferred logic. Even if the app is built against an older NDK > > > and unaware of the Asymm mode existence! > > > > I can't see how we can resolve that case in the kernel except by adding > > a specific call to disable all MTE modes which would obviously only be > > useful for future proofing given that no existing applications would > > support it. > > One option would be to introduce a new, future-proofed prctl with a > wider mask, and throw in a few extra reserved bits just in case. Then > have the legacy prctl always clear MTE_CTRL_TCF_ASYMM. If this problem is real, we can easily tweak the current proposal so the that ASYMM can only be set *if* both ASYNC and SYNC are set. IOW, it's not a specific mode an app requests on its own but rather something the kernel may choose via the preferred mode if the app opted in. We still introduce a new bit for ASYMM but not change the mask. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel