From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93790 invoked by alias); 9 Sep 2019 10:29:59 -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 93779 invoked by uid 89); 9 Sep 2019 10:29:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: EUR03-DB5-obe.outbound.protection.outlook.com Received: from mail-eopbgr40051.outbound.protection.outlook.com (HELO EUR03-DB5-obe.outbound.protection.outlook.com) (40.107.4.51) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 09 Sep 2019 10:29:57 +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=eFG+UbEvxuJwV019qsijPdshkoeP1cAH750nmPRu1bI=; b=6C1nfcdZ2s8mSkGYEzCl+c012153ph1simb82z3P2yoj3gEERs2onbZDF3ShMh1wxRAXHaLFzJ1qb6KRMff1tX3IUWQbNKGszmZA1g9sQ8NDJq2RG79fP+Qh02Ka/jeumZb5ObZd4G/5W8oIQR81v/j5L6hSKzNt3hw6y6gRgnA= Received: from AM6PR08CA0038.eurprd08.prod.outlook.com (2603:10a6:20b:c0::26) by VI1PR08MB3406.eurprd08.prod.outlook.com (2603:10a6:803:7b::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2241.14; Mon, 9 Sep 2019 10:29:52 +0000 Received: from VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com (2a01:111:f400:7e09::202) by AM6PR08CA0038.outlook.office365.com (2603:10a6:20b:c0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2241.14 via Frontend Transport; Mon, 9 Sep 2019 10:29:52 +0000 Authentication-Results: spf=temperror (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=temperror action=none header.from=arm.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of arm.com: DNS Timeout) Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT005.mail.protection.outlook.com (10.152.18.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2241.14 via Frontend Transport; Mon, 9 Sep 2019 10:29:50 +0000 Received: ("Tessian outbound f5cc2e2724f4:v28"); Mon, 09 Sep 2019 10:29:49 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 27899c6747ca8261 X-CR-MTA-TID: 64aa7808 Received: from 30462068dcbf.1 (ip-172-16-0-2.eu-west-1.compute.internal [104.47.8.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4C73BFB6-EEB8-4447-868B-36962572DFEA.1; Mon, 09 Sep 2019 10:29:44 +0000 Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-am5eur03lp2055.outbound.protection.outlook.com [104.47.8.55]) by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 30462068dcbf.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 09 Sep 2019 10:29:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z0HoSqBQlgt4J1eKegh3WGPn4LjZ//Qi9INU7qjlUbqhndLxvP7w9FwJkqeNAtnsdcVuh1jzs8oRivDw/g1N/qbycR2SCn5+PjYXnmMAnZjDLsapEbkHhVCnpweiPdvxOrfShPN49VxHNgrNV+I5czPC5XoZCG9wFCo43/g8XaQMqz16lezEGvMqEGb1Cy0s0WYgiegS/L1M/DIbgojVt/LCkIozJW62S1dG2QDWM1fqMNT5FFV1dO36KuZk9tB5XP8tpCa2V8dsFT6Lbyu1F7i5H7gGCUShxgoD5S9FAtBXwmd0cTmybmfX5O5nfCLJApBfqTOxO/Ylt6ZrVj3LlQ== 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=eFG+UbEvxuJwV019qsijPdshkoeP1cAH750nmPRu1bI=; b=kqFcQP2KMPZBzUC0iqymFPW6lhcZf1U49WiCL5vdIqyoU5qJK/HIYK3nZZhIHgHs/brWOEVCoER2EumNUNGelZat0297/ThEug+ppeLAtm/LhoddR5ykEG3MjU6NpuPh1iqZpEpdCQf/h2wJBMwYY4ZbWKQksje7wrcyu1wdQnad6YdzQ2Nujsb6Uszco0d9wyGuJhOGAG7e927k6WkU8W6jDH2k27S5A3Uur6xShHskFrklWkcin5DNq4J3uALJ3uueFuLWyB6p8puqJghvfZKpaQYSivCiceX7X/JNrct38sNhngr4OsGLmoCPIu2hjvSZjP+GIZwUNms1C5naFw== 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=eFG+UbEvxuJwV019qsijPdshkoeP1cAH750nmPRu1bI=; b=6C1nfcdZ2s8mSkGYEzCl+c012153ph1simb82z3P2yoj3gEERs2onbZDF3ShMh1wxRAXHaLFzJ1qb6KRMff1tX3IUWQbNKGszmZA1g9sQ8NDJq2RG79fP+Qh02Ka/jeumZb5ObZd4G/5W8oIQR81v/j5L6hSKzNt3hw6y6gRgnA= Received: from VI1PR08MB5471.eurprd08.prod.outlook.com (52.133.246.83) by VI1PR08MB4078.eurprd08.prod.outlook.com (20.178.127.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2241.14; Mon, 9 Sep 2019 10:29:42 +0000 Received: from VI1PR08MB5471.eurprd08.prod.outlook.com ([fe80::206a:65bd:e6a9:536b]) by VI1PR08MB5471.eurprd08.prod.outlook.com ([fe80::206a:65bd:e6a9:536b%2]) with mapi id 15.20.2241.018; Mon, 9 Sep 2019 10:29:42 +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: [RFC][PATCH 5/X][libsanitizer] Introduce longjmp/setjmp interceptors to libhwasan Date: Mon, 09 Sep 2019 10:29:00 -0000 Message-ID: References: <156778058239.16148.17480879484406897649.scripted-patch-series@arm.com> In-Reply-To: Authentication-Results-Original: spf=none (sender IP is ) smtp.mailfrom=Matthew.Malcomson@arm.com; X-Microsoft-Antispam-Untrusted: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600166)(711020)(4605104)(1401327)(4618075)(2017052603328)(7193020);SRVR:VI1PR08MB4078; x-checkrecipientrouted: true x-ms-oob-tlc-oobclassifiers: OLM:9508;OLM:9508; X-Forefront-Antispam-Report-Untrusted: SFV:NSPM;SFS:(10009020)(4636009)(396003)(136003)(376002)(346002)(366004)(39860400002)(189003)(199004)(86362001)(6246003)(2616005)(476003)(11346002)(446003)(486006)(2501003)(478600001)(7736002)(54906003)(386003)(6506007)(53546011)(110136005)(14454004)(52116002)(99286004)(305945005)(44832011)(81166006)(81156014)(8676002)(8936002)(26005)(36756003)(102836004)(66574012)(6512007)(6436002)(6486002)(2906002)(186003)(316002)(76176011)(256004)(4326008)(31686004)(25786009)(14444005)(66946007)(66476007)(66556008)(229853002)(64756008)(66446008)(71200400001)(6116002)(31696002)(71190400001)(53936002)(3846002)(5660300002)(66066001);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR08MB4078;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-Message-Info-Original: HYXef3rnP8hOw8SXgt1eAY0wcr5zED4XkasrefXhLEERptgJl4DG4vXOm1QasfNoFDT0nFAgvOAjUHWSS5T+onLP6s/lMTHPaYcCqP53v8TZaleKi+KLbjP83yP/48GMuA+haTIhppqzzlWb3+OUzFRBkymy+wOMjaJLfgG8Ugc5wxC2ui940AeokJlTsdJ8epETA0SfmKM1YOgAq9YRl07CwR+YI6/0A/2jbewwACxDVC/B2gpNh08vuyGAYekE9NcMAx9ZaSvKXZULNgJ+mHzcyhfUsHhPFdLUnzBfZFFeYV0Q9NGEkTV2pQ+FoG6G3iwPX+RVh2OFMWjLNOkSpxuqFUdlVtZrKQECollSAAU8SBpGEFlPzRuRu07rVA+/AL5GsB1HfSxEv3r+c11Ul7xUB40wy1fyhImTer11Foo= x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="Windows-1252" Content-ID: <3EED796036973446B3772B2238E97A25@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: VE1EUR03FT005.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 64661a1f-1271-472a-735d-08d73510a05a X-IsSubscribed: yes X-SW-Source: 2019-09/txt/msg00487.txt.bz2 On 09/09/19 11:01, Martin Li=9Aka wrote: > Hi. >=20 > On 9/6/19 4:46 PM, Matthew Malcomson wrote: >> Ensuring that the shadow stack is cleared on normal function exit will >> be done by adding instrumentation to the function epilogue through the >> compiler. >> longjmp and setjmp are some abnormal methods of exiting the function >> that can't be handled in the compiler since they can be called in >> uninstrumented code to unwind past instrumented function frames. >=20 > I'm curious why you are adding a new code that is not part of libsanitize= r runtime? > Does it mean the current LLVM implementation does not properly handle set= jmp and > longjmp? Honestly -- I'm not sure. I did a basic test that seemed to show clang not supporting setjmp &=20 longjmp and I made a bit of a foray into how one would approach the=20 problem, but I then left it in a partially done state to focus on other=20 things. It also seems on first blush that C++ exceptions are not handled, but=20 again I haven't yet gone and asked anyone in the know. (it's on the list of things to do, but not yet at the top). >=20 > Note that rule of thumb is that we need to upstream all libsanitizer > changes before we merge libsanitizer. We are doing that in order to not > have a bug difference against upstream libsanitizer. That sounds good to me -- I will remember to go upstream when I look=20 into this. >=20 > Martin >=20