From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id JfX/NNi/qWeT2CkAWB0awg (envelope-from ) for ; Mon, 10 Feb 2025 03:59:04 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=j5M1RlJg; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id C878E1E105; Mon, 10 Feb 2025 03:59:04 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.0 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 28AA41E05C for ; Mon, 10 Feb 2025 03:59:03 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D880C3857C7F for ; Mon, 10 Feb 2025 08:59:02 +0000 (GMT) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by sourceware.org (Postfix) with ESMTPS id 00BDE3858D26 for ; Mon, 10 Feb 2025 08:58:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 00BDE3858D26 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=intel.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 00BDE3858D26 Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=192.198.163.15 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1739177923; cv=fail; b=jYF+uFFpRPdx5icbcia5DJ7TWim3lFtZUBhC6Rw0U8olcPMuin9JkJ8gzz/f2rdcZurQqlMiSrLsZzNOiVJkWIfgz+GdCB1lkLtCcZwETZNMCesir51tErm9qIVFYgxCldbFgQVj7wAtsQdDAKkb8/9TO86agYuSuWTHU52SmWg= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1739177923; c=relaxed/simple; bh=vlG7boTkrHaNi1KhkNLHXoJOpsTb0sMINnWsmxNmanY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=o3EtjgX82JRC07lk7H6gKtu460wK9vDpOrmj4d3wLVke9RnYU/5M4IwJlKM9TM98zDTy3Go4WUaAUGqmoySvRbNNoKVA0w5LSiAj/nxJbkRXmGl4BoWNc0Gtu1mXlc2IIK6FBctHtb88TD9qKjmKuyC43LEXsIVkG0GXIUMRlQo= ARC-Authentication-Results: i=2; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1739177923; x=1770713923; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=vlG7boTkrHaNi1KhkNLHXoJOpsTb0sMINnWsmxNmanY=; b=j5M1RlJg9YZaiQOI6rjNmkixbP9bfggdAT8JwIQvpE9PzMcMKrY8TEcT 3pTt11SL6BqCp08dizEPL/7wf6Gp7ovna7nVwcKzYKIBjiS6TQANNf49M NSoIPDBkHBlXJ5Vy4Lw3qYvspWhrXjsSm6whe3pVrPqaOMR5tYSX9mmD+ AaT/7tk3de3sMB85+AWhynUNyspxGohWl8gUSnclUblThT03OR+m2qqzB dseWTVqCHkIYGIRbBt7Ebm156YNkPuwIwijfu+mPWpEuMB776UAqnVFcp BJBwvQSORRjVCJ60Es2pxTnt1ITZ+UEK36vZtid7CkIPefc//f4mEzfCA g==; X-CSE-ConnectionGUID: JxgM8XWvRDeguxc0VSbK/A== X-CSE-MsgGUID: 3gP30hcpRpy19cINLNcUcA== X-IronPort-AV: E=McAfee;i="6700,10204,11340"; a="39898758" X-IronPort-AV: E=Sophos;i="6.13,274,1732608000"; d="scan'208";a="39898758" Received: from fmviesa006.fm.intel.com ([10.60.135.146]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2025 00:58:40 -0800 X-CSE-ConnectionGUID: 0+ASTacWSpyjP7S1+1P8Ug== X-CSE-MsgGUID: kkyuQSVRR4ynE+Sz7I0GHA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,274,1732608000"; d="scan'208";a="111963793" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by fmviesa006.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Feb 2025 00:58:39 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44; Mon, 10 Feb 2025 00:58:39 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.44 via Frontend Transport; Mon, 10 Feb 2025 00:58:39 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.49) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.44; Mon, 10 Feb 2025 00:58:38 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VwIdBy53LQW5s8n/8w3ymC37njxFjAyO0zIO187SNuxsNTz/y8upfK+dqw1Hb1NBLjYZVhTKMnAuFdWZ+uACKaHWhKuhYOlTag04BIZrmbFhc/8RK1itO8sBEOzTEQN4yI4woOFhw4pUm41Tc/apSHZh8bjeNbKhxc03H9as0EWFuu8MvskIHTis9xsk9eUhOy1gVaM6D7JiKtTcrPIagnFizOK7KeW8s7uNsLlQEcuwd89YkPBpogOit1o2ydZtnNxrR0FCGZx5Uvg8/XLWvrD4rvs0dySUd3bXSnFVj3svs34oaaDy8k3XrOyRmfyiv0NEawSt92ztu9x80kQdTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=L3v11wSXwFylB1EB8NYXt+Lzeu1N/35TKDCpe8vlolY=; b=IR8KijrAT9yrnqo64O8jUbJ3RCG9Eh/XEkeXS+mXBZN+ALSeYvimzvlA3EzLokFcQuwCaeUd+VBb18qOkAUCW8fr13OHiEHl2INYWFfWVeSG2SGEGay9CSLCI0nwpw6ETCYtCErQukpfb/RspmwhkRxFS+3ZkAptk+d02vzbzYmTs9Cr1TJA7nYvXvaw8IZRrVpT5bukZsifjgk5OF8CoLqNHWnTHFpSsN++hzyNDmFdqMNJNnCxIfRyiyTgU673L/u7TOut5GYC/2oaHXx136JvIx1AzJpfUTs7TDn77t3urEsIgYW5N4u3f15WxLP4cUkPd2dJRkdn6joaXrSOEw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SN7PR11MB7638.namprd11.prod.outlook.com (2603:10b6:806:34b::22) by LV2PR11MB6071.namprd11.prod.outlook.com (2603:10b6:408:178::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8422.18; Mon, 10 Feb 2025 08:58:36 +0000 Received: from SN7PR11MB7638.namprd11.prod.outlook.com ([fe80::25b8:16dc:755e:34d1]) by SN7PR11MB7638.namprd11.prod.outlook.com ([fe80::25b8:16dc:755e:34d1%5]) with mapi id 15.20.8422.012; Mon, 10 Feb 2025 08:58:36 +0000 From: "Schimpe, Christina" To: Thiago Jung Bauermann CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH 11/12] gdb, gdbarch: Introduce gdbarch method to get the shadow stack pointer. Thread-Topic: [PATCH 11/12] gdb, gdbarch: Introduce gdbarch method to get the shadow stack pointer. Thread-Index: AQHbUxse9kKW2RnGOUOFjFXmNAxV+bM56hyWgAIeK5CAAQ6S6oADcomw Date: Mon, 10 Feb 2025 08:58:36 +0000 Message-ID: References: <20241220200501.324191-1-christina.schimpe@intel.com> <20241220200501.324191-12-christina.schimpe@intel.com> <87ldujhhjh.fsf@linaro.org> <87v7tlqdzw.fsf@linaro.org> In-Reply-To: <87v7tlqdzw.fsf@linaro.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SN7PR11MB7638:EE_|LV2PR11MB6071:EE_ x-ms-office365-filtering-correlation-id: f2be6310-9ceb-49fb-493c-08dd49b11afb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|366016|1800799024|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?GXeDvEOMdFNlKJAStaS79A2tMkpKMnqqqBbkN2xaoR9+PnqyCYexR+DWsKk4?= =?us-ascii?Q?0sy2oWe35lzfpdZIkHE7Ug2DJZ9+9MjNIikMyGw4QF6Y0stAXol0aJKb2W29?= =?us-ascii?Q?jSxmnwIf6ff95luh6Fb1wJfgJkebSmGfeGiZVnB3yodX5/MCItGui3MohkC4?= =?us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YOhvFVXgcyO4/CssvsJA9SqxXzhVo8FL0t?= =?us-ascii?Q?fNyZclH3oiFWdVEBQllKZUED7Th6sRuSwlTR7sdLBaI9AAHiYMg0wjfKMPFP?= =?us-ascii?Q?fEqt7K0ljKVqQm4eUEyrKZNAHd5MrUMcA0Ngwngs2Ai39tHxxUd+0wmXBCer?= =?us-ascii?Q?xmXtghXhkwx7ibxzN91Pfg5mwCpKpR4/FPNWH9wNZDe8sjtpmrU3CqFzv9ua?= =?us-ascii?Q?65SIcqN3Z13A46sH5K+fTm9gYTsFRYocIs9IHNdTp5Xj80jMTFOoqFTMkfqt?= =?us-ascii?Q?kLEM6weXSMMQpdzxNvgC2QscTZsjxrDTQ8HnGedtc2O9rA4ujKShNKEjQ5a1?= =?us-ascii?Q?XX9qgMQ3NZa2TOcTkExonbxjxr247OfglB9R2Tlo/j1T5z6WRw=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN7PR11MB7638.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(366016)(1800799024)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8rao8LfP+8IBJCKl6CZEZ1GpzLQMP4fbTepIjRTaI9YRumOSqmJlv48k0OCT?= =?us-ascii?Q?xA6V37tZtflQUY7Dj6vtlFhNYHYP/glqGi5sha0KCZFdFkT8YqcHhcTIRLU1?= =?us-ascii?Q?jM7LkGbOf1YvgFvP4smmGEGvqqUR8YitdR6Z2nFgCmOz4jmwt3f1TzkSQnK8?= =?us-ascii?Q?1wzXvATzxUfaIUk8epDrheG35afHdT5xhzIWbJ1ubeaxX0If3yYllTn/FJP6?= =?us-ascii?Q?z3Dg3yJGO7yYQojkEM022WtCoVI9yWF6AvKp/9jVUMy7gJg8zR9Pz1XKXZlK?= =?us-ascii?Q?2j9MVtmt8cj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tHfVka?= =?us-ascii?Q?twQ9hmt1EuzldzsxEjOKkemetgIZmwS8BVuPClNkzBIdNMcgWhEMl/rxJKvz?= =?us-ascii?Q?VJs3aeqhNrs6jjOvDYtB5q5aXefQ+xjufqDE2nvzpTE3xcTpVRJ3SpVf75kz?= =?us-ascii?Q?Hv1dH1CANX4JuOAYDcfsbtlIeS4OFF7OcAaCh33MgoU/59V/xUERBZYw6KVO?= =?us-ascii?Q?h8T5BrBmn/kF+qGl9jz4X3V0RfKZnyn9y7UL0oL7MJ3QQVkJVJON5xoXY/W1?= =?us-ascii?Q?CNnSpLeOe7Tv+kUBAh3S8zmq8jv+09P37PEnP8d2c3202IfMUvPIjvifpPQx?= =?us-ascii?Q?GvdCSjtEMMLeiIY88CyAwIc6+45HOvuzYBngNp3CkXTdpDU2MJq3gBcKrcQ5?= =?us-ascii?Q?y9JhzJWURQNzPuIscEPFEbratjJSMlMy4aaBWl7rx4VMDULjjnhTerIuCxEj?= =?us-ascii?Q?Mw=3D=3D?= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN7PR11MB7638.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2be6310-9ceb-49fb-493c-08dd49b11afb X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2025 08:58:36.6723 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 6Qgx7EQA0ySK3DoSwgzMQ/66cFSnAwn9qXjejc7fiZF335PMekU8rMCQjAMnEl3c4sANzov0tnFSxroYLo+/bkZ7ADOpAZZD3NQqH6Z+Tcs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR11MB6071 X-OriginatorOrg: intel.com Content-Transfer-Encoding: quoted-printable X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > -----Original Message----- > From: Thiago Jung Bauermann > Sent: Saturday, February 8, 2025 5:04 AM > To: Schimpe, Christina > Cc: gdb-patches@sourceware.org > Subject: Re: [PATCH 11/12] gdb, gdbarch: Introduce gdbarch method to get = the > shadow stack pointer. > = > = > "Schimpe, Christina" writes: > = > >> -----Original Message----- > >> From: Thiago Jung Bauermann > >> Sent: Thursday, February 6, 2025 4:35 AM > >> To: Schimpe, Christina > >> Cc: gdb-patches@sourceware.org > >> Subject: Re: [PATCH 11/12] gdb, gdbarch: Introduce gdbarch method to > >> get the shadow stack pointer. > >> > >> > >> "Schimpe, Christina" writes: > >> > >> > diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py > >> > index 52f265e8e0e..df70cb082a4 100644 > >> > --- a/gdb/gdbarch_components.py > >> > +++ b/gdb/gdbarch_components.py > >> > @@ -2822,6 +2822,8 @@ Some targets support special > >> > hardware-assisted control-flow protection technologies. For > >> > example, Intel's Control-flow Enforcement Technology (CET) > >> > provides a shadow stack and > >> indirect branch tracking. > >> > To enable inferior calls the function shadow_stack_push has to be p= rovided. > >> > +The method get_shadow_stack_pointer has to be provided to enable > >> > +displaced stepping. > >> > > >> > Push the address NEW_ADDR on the shadow stack and update the > >> > shadow stack pointer. > >> > @@ -2831,3 +2833,11 @@ pointer. > >> > params=3D[("CORE_ADDR", "new_addr")], > >> > predicate=3DTrue, > >> > ) > >> > + > >> > +Method( > >> > + type=3D"std::optional", > >> > + name=3D"get_shadow_stack_pointer", > >> > + params=3D[], > >> > + predefault=3D"default_get_shadow_stack_pointer", > >> > + invalid=3DFalse, > >> > +) > >> > >> Ideally, there should be a comment on this method entry. > >> > >> This method is only used in amd64-tdep.c and i386-tdep.c. IMHO it > >> would be better to put it in i386_gdbarch_tdep instead. > > > > Hi Thiago, > > > > Thank you for the review. > > > > As also discussed here: > > https://sourceware.org/pipermail/gdb-patches/2025-February/215266.html > > , I wonder if it's better to keep the code generic. > = > Indeed, that's a good point. In the case of this method, I have an additi= onal > concern though: its callers assume that if gdbarch_get_shadow_stack_point= er > returns a value, then it means that shadow stacks are enabled in the infe= rior. But > this is an x86 particularity. On AArch64, if the processor supports shado= w stacks > then the shadow stack register is always available, even if shadow stacks= are > turned off. Ah ok, I did not know. > So I think that there should be an additional method to indicate whether = shadow > stacks are enabled in the inferior. Yes, that makes sense. But I want to avoid that we call ptrace twice on x86= , once in the method to check the enablement state and once to get the shadow stack pointer. Would something like that be acceptable as well? Method( comment=3D""" If possible, return the shadow stack pointer. On some architectures, the sh= adow stack pointer is available even if the feature is disabled. To return the shadow= stack enablement state configure SHADOW_STACK_ENABLED. """, type=3D"std::optional", name=3D"get_shadow_stack_pointer", params=3D[("bool &", "shadow_stack_enabled")], predefault=3D"default_get_shadow_stack_pointer", invalid=3DFalse, ) > > And I plan to use the gdbarch method gdbarch_get_shadow_stack_pointer > > in a future series for "bt shadow". > > I shared the commits in this comment: > > https://sourceware.org/pipermail/gdb-patches/2025-February/215178.html > > , > = > Indeed. I see the same assumption in that code as well. Which makes a lot= of > sense since it only needs to support x86. But that will need to be adapte= d when > posted upstream. Yes, I agree. Christina Intel Deutschland GmbH Registered Address: Am Campeon 10, 85579 Neubiberg, Germany Tel: +49 89 99 8853-0, www.intel.de Managing Directors: Sean Fennelly, Jeffrey Schneiderman, Tiffany Doon Silva Chairperson of the Supervisory Board: Nicole Lau Registered Office: Munich Commercial Register: Amtsgericht Muenchen HRB 186928