From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140050.outbound.protection.outlook.com [40.107.14.50]) by sourceware.org (Postfix) with ESMTPS id 3461A3857C4C for ; Wed, 23 Sep 2020 09:10:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3461A3857C4C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Szabolcs.Nagy@arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NzgmUemalOFlEJAnQ3wNlX9VEIBZL6ML6nV9jflSQ4Y=; b=m3YBSeDbljsmuIZszKogWY+F72ZXUjSv4NqUdyTzfUk79C1fUFeaAFsrk1+6L58d1fH3fofESwr5UyasW9qQTUpKhjNoE4Zrtl1sFv0qbuY8VWQeekXXtadw2TSFHjeVVUhzhZt+rnx1FUplMvEim6ty7Fc9cZebKvRSDtFMClI= Received: from MR2P264CA0043.FRAP264.PROD.OUTLOOK.COM (2603:10a6:500::31) by AM6PR08MB3495.eurprd08.prod.outlook.com (2603:10a6:20b:48::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.19; Wed, 23 Sep 2020 09:10:28 +0000 Received: from VE1EUR03FT013.eop-EUR03.prod.protection.outlook.com (2603:10a6:500:0:cafe::67) by MR2P264CA0043.outlook.office365.com (2603:10a6:500::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20 via Frontend Transport; Wed, 23 Sep 2020 09:10:27 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; sourceware.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; sourceware.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT013.mail.protection.outlook.com (10.152.19.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.21 via Frontend Transport; Wed, 23 Sep 2020 09:10:26 +0000 Received: ("Tessian outbound e8cdb8c6f386:v64"); Wed, 23 Sep 2020 09:10:26 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 7ce91b9e131beaf4 X-CR-MTA-TID: 64aa7808 Received: from a77fc1472dc4.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9E55CEE6-CBA8-405D-8F99-F18A560549F5.1; Wed, 23 Sep 2020 09:10:21 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id a77fc1472dc4.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 23 Sep 2020 09:10:21 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FZW67eVYmScC745fIXBdvhfbpEj4Ygp+pv39RWZmKWTatDkgt3PCz8yoVLp1I+jNXQEF6FRpN6lQ1sL3sCAkEWQTOtGPJ9cCz3ymZEzkQvmlopDvdyeHT6nInJQ8J3KtHOPm6Iz80ouWFDIF23BdFNmr5FE40SW7ArMhma+8ZamzKmC0Pbu/cs9jkILA49+iX2hYrAWn8xXRl1yTC9dmGOsllMK6fe+FOjfcOm9ePNPEfm2ICPFW/2fb6YPBIEt4T5piE9FaTcFda996cjsXqICQNOqOjRAb2JBu3bIab4rfaiyR3txQOmvr6adwjTY0ZCcBK6hMIRrfoKoMo7Kq2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NzgmUemalOFlEJAnQ3wNlX9VEIBZL6ML6nV9jflSQ4Y=; b=M4ll7M0Ae44p3bSvTFmL25CQV6QLSeh4NC5b4fZwCTB/4F7swkWKppX9yGdeFMZj9kkhHQd7qlEqosE9y+KCld7d3G+yQBeBgdX7g8pcmp4BZ+O6/8z6TPuvTdo74uGZt+1MtjZ1GvdWTW6D+0JEBjnKuwbxV3AODS99X10R4orr6ri7VeQcEUxk6K+9qcn9WwxpCEB4FslRBnQVm/zv9taJctUE5J+IGaJFo9eHye0/Olptvu/r5dDxlqY7SCBbV1dsisx6z0G+A45MxfsxK4ppRxedzGOigWny7oxNck10RUUPjLM+okdauqAJei1OMf8ALOisOvVVHmmY92kryg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NzgmUemalOFlEJAnQ3wNlX9VEIBZL6ML6nV9jflSQ4Y=; b=m3YBSeDbljsmuIZszKogWY+F72ZXUjSv4NqUdyTzfUk79C1fUFeaAFsrk1+6L58d1fH3fofESwr5UyasW9qQTUpKhjNoE4Zrtl1sFv0qbuY8VWQeekXXtadw2TSFHjeVVUhzhZt+rnx1FUplMvEim6ty7Fc9cZebKvRSDtFMClI= Authentication-Results-Original: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; Received: from VE1PR08MB5566.eurprd08.prod.outlook.com (2603:10a6:800:1a9::7) by VI1PR08MB2848.eurprd08.prod.outlook.com (2603:10a6:802:23::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.20; Wed, 23 Sep 2020 09:10:18 +0000 Received: from VE1PR08MB5566.eurprd08.prod.outlook.com ([fe80::11d4:e51c:433e:ed0a]) by VE1PR08MB5566.eurprd08.prod.outlook.com ([fe80::11d4:e51c:433e:ed0a%7]) with mapi id 15.20.3391.025; Wed, 23 Sep 2020 09:10:18 +0000 Date: Wed, 23 Sep 2020 10:10:08 +0100 From: Szabolcs Nagy To: Catalin Marinas Cc: Will Deacon , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, Dave P Martin , Vincenzo Frascino , Kevin Brodsky , Andrey Konovalov , Peter Collingbourne , Andrew Morton , libc-alpha@sourceware.org Subject: Re: [PATCH v9 29/29] arm64: mte: Add Memory Tagging Extension documentation Message-ID: <20200923091008.GC16385@arm.com> References: <20200904103029.32083-1-catalin.marinas@arm.com> <20200904103029.32083-30-catalin.marinas@arm.com> <20200917081107.GA29031@willie-the-truck> <20200917090229.GA10662@gaia> <20200922155248.GA16385@arm.com> <20200922165529.GH15643@gaia> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200922165529.GH15643@gaia> User-Agent: Mutt/1.9.4 (2018-02-28) X-ClientProxiedBy: SN4PR0401CA0026.namprd04.prod.outlook.com (2603:10b6:803:2a::12) To VE1PR08MB5566.eurprd08.prod.outlook.com (2603:10a6:800:1a9::7) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.54) by SN4PR0401CA0026.namprd04.prod.outlook.com (2603:10b6:803:2a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3391.19 via Frontend Transport; Wed, 23 Sep 2020 09:10:14 +0000 X-Originating-IP: [217.140.106.54] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9b80e89e-8d94-4f2f-da2b-08d85fa082fe X-MS-TrafficTypeDiagnostic: VI1PR08MB2848:|AM6PR08MB3495: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:9508;OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 2akHAG4RMNb0jOxd0X3XK8mOhMlE4ZGGAeK6tbEvcFiBtbq4JWgeUdkJPY7dAUAcZDUYNQ9T+ukAY+y4blBWnTDg1DZYrv42j3qt0sSUY2xWtgB45WyVp9QQCdZG0jsaVZ6PmII5pSoOVaUqN3zXaXxGPet1uk1g9Dy/lkECJTO3ecsLvprCeo97HxckXT1GliaHjkDnNzvPfpPRu6724KnaKbFJOQ8HPG7vKyOLxq8sAV5GMdckRTh8KonjFFEX5dMchZMZe4NZQ7zgh7VYBMzxFAX4aL9LwqFH4c0pfpMLUMEgB/eG7MZx0pLF4fieMJiOz/X7iJvqHB07SBHrVg== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VE1PR08MB5566.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(366004)(39850400004)(346002)(376002)(136003)(186003)(16526019)(83380400001)(6862004)(33656002)(86362001)(956004)(2616005)(478600001)(8936002)(52116002)(26005)(7696005)(55016002)(54906003)(5660300002)(44832011)(6666004)(8886007)(8676002)(6636002)(1076003)(66946007)(66556008)(4326008)(66476007)(316002)(37006003)(2906002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: k10POoofrRxwlsnRk5D7EU3HVisKT81v/k4DE6eOYSG/uFHHe3gOvAPtGyI9ddzUqhyPDMJACUZXE6KFtNOCWWbYlMlPQHsoZ9MOTmGgjYbtI6jcLS0nwx9BGXLSX/RgHG2pmGXMH8VdOV6Dx9aw33zkxdSTfEc8zNeiWWSLjDaMrG1xMCUdewj8fcDShPN8CtSgtorGMblmgxkjtHeVt3CfvVpsnIA6Xp/oTvg7xcDbRj0z5uZycLjpzx3zEChnyG5OiZIgFyMqCBR9Tu3b1N7MiJIULPZo0/AbvFM0Q+X2vV+6HUWIkmTSmjN2Q3RVwVflR+Fn4MFOYy08V6AbaBmXsVJM7NY36WJrpBR35jTTNaPUUqu3Lo2lsxkTg7dUH9EAm/LS1EOCwucZme29e30cH8wrcoR+PChdwmI55BngBi1shVWo8L425UD1UWHLdKzN1Nt6QpENv505Z8PDHj52SI93Y3FdEZth/xldrXeFCM2zY0NLuPr5+q82m2xT4mb7tRCb0D59P49Lcgby8Q1tvv2CVRru3pV2VLaET2mH9teZKxO9VcmGXSmzkgL1Wgibjk+3V+iELxeDn+wyQYUUELefhL0y++6AQGi95tFx7mrpk+0ogXCLfs5wK4K2WjzMPQjmPmUwAy59mUw73g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB2848 Original-Authentication-Results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: b585b680-41c3-42e2-863f-08d85fa07dcb X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pxcAZ2pOU4ST5KQMEikJZDhzvXb9NmgGlijNH43UnZPWOmWWS7OFCjHfC/hHjeYUmpAQEdyoMtD/zGC8G7vFNc4UDr6/zXPtC0/4kZhVdgYHHALRBTQmkVrIf195F/B5njvm5bDCreA0Muf8SsMOuzHaK8DEeuXyPjsO7QOLidCY21DDDAUICkfaHJljPNe3UzmHdY235zJMnATZyed5UX9Vka+6gnPOeMxe+TEFU/QCFpYTpa8Ph/pUcFRTXvEwtZPkenfj4Wqqk1e6kGMnJUBW9nEMk9g/rpLP+G+36BXGJlioYK7YWgN8bIkOy6jydjICXdEMCfcojGT4q5TDM4mcgw2MSmP8rLgd24hdAoL+2tBRCHk0CGwjHXOgdL0ON/mIE6nICL63amSziv3hcA== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(4636009)(396003)(346002)(376002)(39850400004)(136003)(46966005)(81166007)(336012)(2906002)(4326008)(316002)(47076004)(36756003)(186003)(82310400003)(44832011)(16526019)(36906005)(1076003)(356005)(8936002)(8676002)(478600001)(956004)(86362001)(55016002)(26005)(82740400003)(6666004)(7696005)(54906003)(33656002)(70586007)(8886007)(70206006)(2616005)(83380400001)(6862004)(37006003)(5660300002)(6636002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Sep 2020 09:10:26.8971 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9b80e89e-8d94-4f2f-da2b-08d85fa082fe X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT013.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3495 X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP, UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2020 09:10:35 -0000 The 09/22/2020 17:55, Catalin Marinas wrote: > On Tue, Sep 22, 2020 at 04:52:49PM +0100, Szabolcs Nagy wrote: > > if we add a kernel level opt-in mechanism for tag checks later (e.g. > > elf marking) or if the settings are exclusively owned by early libc > > code then i think the proposed abi is ok (this is our current > > agreement and works as long as no late runtime change is needed to the > > settings). > > In the Android case, run-time changes to the tag checking mode I think > are expected (usually via signal handlers), though per-thread. ok that works, but does not help allocators or runtimes that don't own the signal handlers. > > i'm now wondering about the default tag check mode: it may be better > > to enable sync tag checks in the kernel. it's not clear to me what > > would break with that. this is probably late to discuss now and libc > > would need ways to override the default no matter what, but i'd like > > to know if somebody sees problems or risks with unconditional sync tag > > checks turned on (sorry i don't remember if we went through this > > before). i assume it would have no effect on a process that never uses > > PROT_MTE. > > I don't think it helps much. We already have a requirement that to be > able to pass tagged pointers to kernel syscalls, the user needs a > prctl(PR_TAGGED_ADDR_ENABLE) call (code already in mainline). Using > PROT_MTE without tagged pointers won't be of much use. So if we are to > set different tag check defaults, we should also enable the tagged addr > ABI automatically. > > That said, I still have a preference for MTE and tagged addr ABI to be > explicitly requested by the (human) user either via environment > variables or marked in an ELF note as "safe with/using tags". Given the > recent mremap() issue we caused in glibc, I'm worried that other things > may break with enabling the tagged addr ABI everywhere. > > Another aspect is that sync mode by default in a distro where glibc is > MTE-aware will lead to performance regressions. That's another case in > favour of the user explicitly asking for tag checking. ok this all makes sense to me. > > Anyway, I'm open to having a debate on changing the defaults. > > -- > Catalin