From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-eopbgr140085.outbound.protection.outlook.com [40.107.14.85]) by sourceware.org (Postfix) with ESMTPS id DA8B2384A87E for ; Tue, 24 Nov 2020 10:13:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DA8B2384A87E Received: from AM5PR0502CA0011.eurprd05.prod.outlook.com (2603:10a6:203:91::21) by DBAPR08MB5846.eurprd08.prod.outlook.com (2603:10a6:10:1b0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.22; Tue, 24 Nov 2020 10:13:14 +0000 Received: from AM5EUR03FT046.eop-EUR03.prod.protection.outlook.com (2603:10a6:203:91:cafe::2f) by AM5PR0502CA0011.outlook.office365.com (2603:10a6:203:91::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Tue, 24 Nov 2020 10:13:13 +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=pass 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 AM5EUR03FT046.mail.protection.outlook.com (10.152.16.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.20 via Frontend Transport; Tue, 24 Nov 2020 10:13:13 +0000 Received: ("Tessian outbound e0cdfd2b0406:v71"); Tue, 24 Nov 2020 10:13:12 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 4e52e68761aeb628 X-CR-MTA-TID: 64aa7808 Received: from 8519b2ab65ba.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 7B044870-F60E-4C92-9C61-4318E1E25D93.1; Tue, 24 Nov 2020 10:13:03 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 8519b2ab65ba.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 24 Nov 2020 10:13:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kH5BxEvcWV1w3GyqmmkyOf6ftmumFw+7WsziXHtVz7PI0OrHsdbJ6ihTF8VXeoWwF1OKKD3g3ZcAWGKuh96VH2uy2cU9SyCqZjwqcs2pfuixskDvLvghtjRhTfVXNK66NH2eXz5GXcwx0PBXFW8HngC5nBljAD9Oymyx2ZvU1KZgGStryMWUGvCAvBL+2vocrVju85J3uDGyR98ARAhdakY2UXWcOc62xJWrBaf6HyXMdkxmWf0xNdrktsPFXKb+vRJWG3VScEFiiq9XKbnmuR8eNgRZOCvJPvuzjWXA4CDEzn9Ww7XzOO+zCkDnmg2bM3TJbclEyqrfD5G+xBiYng== 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=t+K6R0Ue75rtKJC9gNGIB3wxHxqxSCSSEbDvSE8kQfw=; b=N/+0DrkeyvEQpSXsvGfA4BikL3O8qjiMVCeJd/GDgJOXvsi7+C3TCdhfX25xXG0Ef3apsHoyS2EuJeSxK62eXSGZwgJ6w+rHMfIzH/N5ehfoUyLZgguDU1aduu6ua/tuWvfiTa1v6uJbTMEH/M3Um5QZFPMmKLqAj94i5ljchu54y00TQKAvnoZt5NPOjT5kIyFkRUI9G8bqo25gWayLDAArKP5WfUF9jj3tv8A6Td2lITReHXAduTr1HTAXJoyaVTFKrtqWmG3Vu7KhW7rw5TZPBPKoWFhPVhXD5DHw7UsijLzj4hO5W6B2o9Nllwou1uvQ6j3c8OY9fd5DZ6TY5w== 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 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 PR3PR08MB5564.eurprd08.prod.outlook.com (2603:10a6:102:87::18) by PA4PR08MB6270.eurprd08.prod.outlook.com (2603:10a6:102:f3::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3589.24; Tue, 24 Nov 2020 10:13:01 +0000 Received: from PR3PR08MB5564.eurprd08.prod.outlook.com ([fe80::ac13:db5:ef4:2dd2]) by PR3PR08MB5564.eurprd08.prod.outlook.com ([fe80::ac13:db5:ef4:2dd2%4]) with mapi id 15.20.3589.030; Tue, 24 Nov 2020 10:13:01 +0000 Date: Tue, 24 Nov 2020 10:12:59 +0000 From: Szabolcs Nagy To: Richard Earnshaw Cc: libc-alpha@sourceware.org, dj@redhat.com Subject: Re: [PATCH v3 0/8] Memory tagging support Message-ID: <20201124101258.GK20578@arm.com> References: <20201123154236.25809-1-rearnsha@arm.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20201123154236.25809-1-rearnsha@arm.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [217.140.106.54] X-ClientProxiedBy: LO2P123CA0038.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600::26) To PR3PR08MB5564.eurprd08.prod.outlook.com (2603:10a6:102:87::18) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from arm.com (217.140.106.54) by LO2P123CA0038.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Tue, 24 Nov 2020 10:13:01 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 865ab9d6-53ed-4099-c754-08d890618dc0 X-MS-TrafficTypeDiagnostic: PA4PR08MB6270:|DBAPR08MB5846: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true NoDisclaimer: true X-MS-Oob-TLC-OOBClassifiers: OLM:1060;OLM:1060; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: QA+/TrQd30yHEdoq6Brn3TWJSbZiX+4rnNAdu6DDbPHCaO0ho9fECVj2Oj2VT6RbKjELxZtkYRjEW4wm6K5V7BB0TffVatW7CHJbTKv0Lif9+HDH2KpkEHZpvAWnK7DbqkoH0KDKBfzJNzck0qBrdSftwimjfEPqr8eKQbgRkR7hNznMe8vRg0hL0wgwReaALZ+bESjyRQYfTcBUgUAPdar7juYL2y2OGCfm7FGmTa/wWJYEU/vzVfAzMdRs+J4rBw1wct3FTtldSNMwsUCNKlQc5cwrD/Ozdp+3/E/FTovPgKk8qPObPDWtVRfIwXp0KrRflW4/MbY/u/7KVms4lQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR3PR08MB5564.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(396003)(376002)(39860400002)(136003)(33656002)(66476007)(37006003)(316002)(16526019)(186003)(1076003)(26005)(86362001)(8886007)(478600001)(36756003)(2616005)(956004)(5660300002)(8676002)(83380400001)(55016002)(7696005)(44832011)(66556008)(52116002)(66946007)(2906002)(4326008)(6862004)(6636002)(8936002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: vjin0DvYFN68ifT3WOha+fs+JfFYtzAfMHXnXxBnV5LNctdBk6hRbh7ORD1o94sbyLkld2IQwt0ynrgzfEczS6noTmovyv6dEOfe4cwRtP8HJBGOBnim+V2K2OmY52PqleRZfWsXppR01TocwCS5JvE48FCkeqt+vC5+sUrIaITbQ2SOgiqSy0L606UwBHh+qbsxdtiuhXU6MaUUSP7CYqd4gJUe09209T3z7xs9cGC2LJSp8JqzKBOdEnLSjDaKvFK/UN0vMk/MZoFCC77NUJ0LTddv9yJOQGqeIRQMD79TEv/EMuk05nnPbJxcu+Zz6Bvg30aDnYU1qNwzR8zfYI0PQUGI69mBoPqY5VLLNmdin6CtCHn8P1LKByOtBojCqnkjPq6V0lQDwTj1dpIFZotm/HhFZwI1Y+kVa24WhgdKXFT429h6HQcoHq8onBHfzExodsoV6m/eFznAg2QubtRpFeHGHK+GHrECkDSszELTkLD8Rg0bsbsN8YCdtXoT4PCnCcMHukJ13cOcNaktMGSNnul6Uzq0vnXquuV1tfZVNP0AxUDn5ePbtLjAo0i5dF7JWQ2XGW7n6P35lNj37+uAJbU6v0qfkNib+fnGdTu5WCLy38ivNNJogHCeu6S9cc4dXG7ZbQ7AT1TZoBLD/ahVz/f4w5Lv59RWcTZu8p+hcDtD3jR0lyo8cEUx4WLrv9dFUch7Jz+JeTRx6A4bo5U373by/dmUBH1XxhVWG9+mY8a0rSOs8KfgT2eH0HSrjrOSh0s2ZWckqo3Ji5btqNE0g6q7L8XROSx17wmzZ8CxfO+/Twf3tn2pk0s5yNz/7S/MeIO+0q7pV9pVBApVX84CCeFConK8jDDXfcaYfRMN3JtoL80Y/SmOKNGyoZNTea9w6HAt3VqsfHVkXQQmSQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR08MB6270 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: AM5EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 94f97814-41fa-4af2-32db-08d890618647 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FYtPu3Ci/b9VhQu3xA/ShNCZcADmfjaH9F0J3MeojPXNpIetTtVi6K9jy+gKTH15lOuASNu4wG2bDjjInG4bVB335FucP2UXevsULMRtNAraa/agb1ZHe0ov7HigfFKkqFuIVJC5guXrJUk/iFhkirqt0r0iAgcZWEa+zBfJfNUH4xkYzQmWiXUwAseug1XTz1S4xCLx1uM1qzLPK+/yIos0AFat2QLXiiUS2guUm7vyucv4Su129ENhO5qZh+gghaBaPCbjhpf1L+mfr+9cAbpghejjqgq76O91JNn93H2LPSwsvoFsiVzCCpFCaC0SOc7pLzdQ3Jt88R+leODvnUWWoEb5uf1GJDpXODte2Y2Ys/5mQa9ssT1+ayIi9T1TmT+RDytzD/STSNgbmPGKSQ== 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)(136003)(39860400002)(46966005)(82740400003)(107886003)(6636002)(5660300002)(47076004)(83380400001)(336012)(81166007)(356005)(4326008)(36906005)(37006003)(956004)(86362001)(7696005)(316002)(36756003)(70586007)(33656002)(70206006)(2616005)(186003)(6862004)(44832011)(8886007)(16526019)(82310400003)(1076003)(478600001)(26005)(55016002)(2906002)(8676002)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2020 10:13:13.6804 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 865ab9d6-53ed-4099-c754-08d890618dc0 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: AM5EUR03FT046.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBAPR08MB5846 X-Spam-Status: No, score=-8.5 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: Tue, 24 Nov 2020 10:13:17 -0000 The 11/23/2020 15:42, Richard Earnshaw wrote: > This is the third iteration of the patch set to enable memory tagging > in glibc's malloc code. It mainly addresses the following issues raised > during the previous review: > > - Clean up/add some internal API documentation > - Remove ROUND_UP_ALLOCATION_SIZE and use some conditionalized code > in checked_request2size instead. > - Support MALLOC_CHECK_ in conjuction with _MTAG_ENABLE. > > The first two issues are addressed in patch 4 of this series, and the > third in patch 5. I intend to merge patches 3, 4 and 5 into a single > update to the malloc code before the final commit; I've kept them > separate for now to (hopefully) simplify the review. > > The patches have all been rebased against master as of 2020/11/20. > > I spent quite a bit of time while working on these looking at whether > the code could be refactored in order to reduce the places where > SIZE_SZ was being added (in different multiples) to various pointers. > I eventually concluded that this wasn't significantly improving the > readability of the code, but one change has survived - I've replaced > usage of 2 * SIZE_SZ with CHUNK_HDR_SZ when it is clear that this is > referring to the header block at the start of a chunk. > > I've pushed a copy of this patch series to rearnsha/mte-v3.0, since I > understand some people want to try the patch series as a whole. cross testing with --enable-memory-tagging and _MTAG_ENABLE=3 in qemu with arm64 for-next/mte linux branch, the new failures i see: FAIL: malloc/tst-malloc-backtrace FAIL: malloc/tst-mallocstate FAIL: malloc/tst-safe-linking FAIL: malloc/tst-tcfree1 FAIL: malloc/tst-tcfree2 FAIL: malloc/tst-tcfree3 all these tests have use after free FAIL: posix/tst-mmap unaligned mmap over malloced memory now fails with ENOMEM instead of EINVAL. i think these are all reasonable failures for mte. (the malloc/ ones can be unsupported, and the mmap test can use mmaped memory instead of malloced)