From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64707 invoked by alias); 23 Oct 2019 11:01:34 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 64491 invoked by uid 89); 23 Oct 2019 11:01:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-10.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy=aim, near, colour, tbi X-HELO: EUR03-DB5-obe.outbound.protection.outlook.com Received: from mail-eopbgr40070.outbound.protection.outlook.com (HELO EUR03-DB5-obe.outbound.protection.outlook.com) (40.107.4.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Oct 2019 11:01:27 +0000 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=XVCkrcUZxZPFXuY9CvlJahRCyWDP+LCXhCBs6I17Gxw=; b=7Rz7c7kwvmf1YsmHdyZ4q2pQ8Wcyi+GVgx5jX+9RCpN0hx6SD2SQKf05spu/MfGIFc4dKk4xasmTWZSffRERpVal/fDu59PrA/JZSdgRHV5mSazv5dN/XQaEOLA3ogYMXZw75UOTxDlUWrT6DHZn0bg1weJycesy8Fz6rqtj8oc= Received: from DB7PR08CA0022.eurprd08.prod.outlook.com (2603:10a6:5:16::35) by HE1PR0801MB1978.eurprd08.prod.outlook.com (2603:10a6:3:52::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.22; Wed, 23 Oct 2019 11:01:23 +0000 Received: from DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e0a::208) by DB7PR08CA0022.outlook.office365.com (2603:10a6:5:16::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2367.23 via Frontend Transport; Wed, 23 Oct 2019 11:01:23 +0000 Authentication-Results: spf=fail (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; gcc.gnu.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;gcc.gnu.org; dmarc=none action=none header.from=arm.com; Received-SPF: Fail (protection.outlook.com: domain of arm.com does not designate 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 DB5EUR03FT050.mail.protection.outlook.com (10.152.21.128) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2367.23 via Frontend Transport; Wed, 23 Oct 2019 11:01:23 +0000 Received: ("Tessian outbound 6481c7fa5a3c:v33"); Wed, 23 Oct 2019 11:01:22 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c482bfca5631f921 X-CR-MTA-TID: 64aa7808 Received: from d8ff4f2e913a.1 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.2.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id A029FEF5-1C6D-4134-B677-49EEB02F76C5.1; Wed, 23 Oct 2019 11:01:17 +0000 Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01lp2057.outbound.protection.outlook.com [104.47.2.57]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d8ff4f2e913a.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384); Wed, 23 Oct 2019 11:01:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mqq9/k3PQzhSIQnfTFLyo7jlYpUVtMTeTtbWStUc0xMtgeaAWibmVcYVJ2OfxCApNCONtHdUD7awBeQKWhn+MxfI+0cccJ9EmDbE00i6HKvEnPkuEk/BCNloc+WE79Z94iIYPq2CjKPmtKd8ZItrgYsd3aOIazubfTTP3hiwxM+r/B/jQqUsu+4sMxhc8U6HCIcGpe/EorDMnaySszfqhJ912IGpTxadvLnjavCssBb7RvXSC0ixGnCFbdO4/Axzgah2l+rK15D7YzPzTEOqd81Il4rghSRT706IFM0FEUa4M8hSEsH5WFmHd0DUehqZmhrlrQw+93lY56RoTTC2kA== 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=XVCkrcUZxZPFXuY9CvlJahRCyWDP+LCXhCBs6I17Gxw=; b=OO/0HhJSJetdakK0KQI5aZObMjFV2XfqWN6VD93pGhdiqCFeea69kzAxcjo2H9XkYFj0A7HCcVpHcGtbSJSsronh2HnVoH5e7iTuDDQ2NfDhtuzXrBoZVO0nhzCfQPtD4nVaRiNNuuSWNw8MZaV+tK2PFdLQyVncdQql4S01mNsauJwEEJimbZkHBdbgN5ZkAfxALZeT/Uf2hTzkvuiIVnIRJ45ipbQYOGiqp3D+fvf3zEe65PqYjmHgaB/PO+2AsZjqHNzHpJcg04g1iGnE/9SU/J58sc06MDeaFzBwe9M+d5M0qD9XPDb+lzzpin8m1XDJLZGp1ovHvOrQY+ONRA== 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=XVCkrcUZxZPFXuY9CvlJahRCyWDP+LCXhCBs6I17Gxw=; b=7Rz7c7kwvmf1YsmHdyZ4q2pQ8Wcyi+GVgx5jX+9RCpN0hx6SD2SQKf05spu/MfGIFc4dKk4xasmTWZSffRERpVal/fDu59PrA/JZSdgRHV5mSazv5dN/XQaEOLA3ogYMXZw75UOTxDlUWrT6DHZn0bg1weJycesy8Fz6rqtj8oc= Received: from VI1PR08MB5471.eurprd08.prod.outlook.com (52.133.246.83) by VI1PR08MB2880.eurprd08.prod.outlook.com (10.170.238.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.22; Wed, 23 Oct 2019 11:01:15 +0000 Received: from VI1PR08MB5471.eurprd08.prod.outlook.com ([fe80::6c84:4a3e:f1fd:3339]) by VI1PR08MB5471.eurprd08.prod.outlook.com ([fe80::6c84:4a3e:f1fd:3339%3]) with mapi id 15.20.2367.022; Wed, 23 Oct 2019 11:01:15 +0000 From: Matthew Malcomson To: =?Windows-1252?Q?Martin_Li=9Aka?= , "gcc-patches@gcc.gnu.org" CC: "dodji@redhat.com" , nd , "kcc@google.com" , "jakub@redhat.com" , "dvyukov@google.com" Subject: Re: [Patch 0/X] [WIP][RFC][libsanitizer] Introduce HWASAN to GCC Date: Wed, 23 Oct 2019 11:02:00 -0000 Message-ID: <8a277aa7-7db7-55d0-0b8e-6e2fe08292b0@arm.com> References: <156778058239.16148.17480879484406897649.scripted-patch-series@arm.com> <9f0727e1-1e6b-ae5f-f854-52557afe0a2b@suse.cz> In-Reply-To: <9f0727e1-1e6b-ae5f-f854-52557afe0a2b@suse.cz> Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Matthew.Malcomson@arm.com; X-MS-Exchange-PUrlCount: 1 x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4636009)(346002)(366004)(39860400002)(136003)(376002)(396003)(189003)(199004)(81156014)(14444005)(486006)(6436002)(86362001)(6512007)(316002)(305945005)(229853002)(4326008)(6306002)(14454004)(6486002)(8676002)(81166006)(478600001)(54906003)(6246003)(25786009)(8936002)(31696002)(386003)(66446008)(2906002)(6506007)(71190400001)(66476007)(66556008)(66066001)(446003)(2616005)(99286004)(76176011)(71200400001)(6116002)(102836004)(186003)(52116002)(110136005)(3846002)(66574012)(31686004)(5660300002)(36756003)(2501003)(256004)(476003)(7736002)(64756008)(26005)(44832011)(11346002)(66946007)(53546011);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR08MB2880;H:VI1PR08MB5471.eurprd08.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: i3G78ArKyii5zBrMvk0huLSQuKx/jnACTbN+EF445ma/k1iQUrUz4GN6dUc+RX4ztGl48OmLU/odmg5IuiQJtWOfP3t4Ve4SaCJ5+tKASND3uxPhuDR7PWTwzAn4NXSfFKc9sJzU7ivmcA1YcJTGr90KPRSdWw1bZa2XbRaekQCZufPDAuUCm+r0eTmoq2y5wwyAVx4W79olA9nd+rJn0dg1i5UUZGc92m2xAj97pdBcBgWRUCG51MRO3Krx6xVCB4TTchhHPaQa+zlc+bTnU2aPQ7FNjlHD2Ydysl+yK41PseWUgEcu6O6d37PVvj//uSaF+u2eD3CSFEi1C3SWpOLcsBeZlIg69eA26c8SezMaIgYNap5D0LzUeXuQuZGiljPV/mhKu6qjMpOgUkUlau288UJYiAHXK6T2gO1aKDagmzLf6nnBKWO4rXSCiX6fAy0wYOeBUGMFeZNaVHZRBw== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-ID: <2690043E66DA0A449CBB33E537F9BBED@eurprd08.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Original-Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Matthew.Malcomson@arm.com; Return-Path: Matthew.Malcomson@arm.com X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5EUR03FT050.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 240f4ab0-77a5-4193-3adb-08d757a852fe X-IsSubscribed: yes X-SW-Source: 2019-10/txt/msg01636.txt.bz2 Hi Martin, I'm getting close to putting up a patch series that I believe could go=20 in before stage1 close. I currently have to do testing on sanitizing the kernel, and track down=20 a bootstrap comparison diff in the code handling shadow-stack cleanup=20 during exception unwinding. I just thought I'd answer these questions below to see if there's=20 anything I extra could to do to make reviewing easier. On 23/09/19 09:02, Martin Li=9Aka wrote: > Hi. >=20 > As mentioned in the next email thread, there are main objectives > that will help me to make a proper patch review: >=20 > 1) Make first libsanitizer merge from trunk, it will remove the need > of the backports that you made. Plus I will be able to apply the > patchset on the current master. Done > 2) I would exclude the setjmp/longjmp - these should be upstreamed first > in libsanitizer. Will exclude in the patch series, upstreaming under progress=20 (https://reviews.llvm.org/D69045) > 3) I would like to see a two HWASAN options that will clearly separate the > 2 supported modes: TBI without MTE and MTE. Here I would appreciate t= o have > a compiler farm machine with TBI which we can use for testing. I went back and looked at clang to see that it uses=20 `-fsanitize=3Dhwaddress` and `-fsanitize=3Dmemtag`, which are completely=20 different options. I'm now doing the same, with the two sanitizers just using similar code=20 paths. In fact, I'm not going to have the MTE instrumentation ready by the end=20 of stage1, so my aim is to just put the `-fsanitize=3Dhwaddress` sanitizer= =20 in, but send some outline code to the mailing list to demonstrate how=20 `-fsanitize=3Dmemtag` would fit in. ## w.r.t. a compiler farm machine with TBI Any AArch64 machine has this feature. However in order to use the=20 sanitizer the kernel needs to allow "tagged pointers" in syscalls. The kernel has allowed these tagged pointers in syscalls (once it's been=20 turned on with a relevant prctl) in mainline since 5.4-rc1 (i.e. the=20 start of this month). My testing has been on a virtual machine with a mainline kernel built=20 from source. Given that I'm not sure how you want to proceed. Could we set up a virtual machine on the compiler farm? > 4) About the BUILTIN expansion: you provided a patch for couple of them. = My question > is whether the list is complete? The list of BUILTINs was nowhere near complete at the time I posted the=20 RFC patches. Since then I've added features and correspondingly added BUILTINs. Now I believe I've added all the BUILTIN's into sanitizer.def this=20 sanitizer will need. > 5) I would appreciate the patch set to be split into less logical parts, = e.g. > libsanitizer changes; option introduction; stack variable handling (c= olour/uncolour/alignment); > hwasan pass and other GIMPLE-related changes; RTL hooks, new RTL inst= ructions and expansion changes. >=20 Will do! > Thank you, > Martin >=20=20=20=20=20 >=20