From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id Ve2hDya7qWfR1CkAWB0awg (envelope-from ) for ; Mon, 10 Feb 2025 03:39:02 -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=V6+Xt1sv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 19C001E105; Mon, 10 Feb 2025 03:39:02 -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 C424C1E05C for ; Mon, 10 Feb 2025 03:39:00 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 448F53858289 for ; Mon, 10 Feb 2025 08:39:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 448F53858289 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=V6+Xt1sv Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.14]) by sourceware.org (Postfix) with ESMTPS id DE8EA385841D for ; Mon, 10 Feb 2025 08:37:58 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DE8EA385841D 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 DE8EA385841D Authentication-Results: server2.sourceware.org; arc=fail smtp.remote-ip=192.198.163.14 ARC-Seal: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1739176679; cv=fail; b=S3Jwjv2A0DTO00ynta6p06kDlyesaY8LOiuGELoi37YHiPVdkXTSUa1tVR/1VnKoXN0GbrC2tU8gd2Jla4QaRPNtTb0/f43GEslAW/Yup950870JyAJKFLhZAO90m8JTspXLMBWcW1dpon+H7o/BdS0Nb/IWjG3newxsStUsgPo= ARC-Message-Signature: i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1739176679; c=relaxed/simple; bh=Zz1jD+AlP6uhp6Py9YnVs2LU7Yks38bT/3C09bVc/cE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Kix3ZDq2NXLfbK/7JKBZCqCWTsXu8NV5XCNpNlklTlJiVkyIOgq6Xc6HHHaqGIsVYmogz/KSf71WFo9XbNGi97Ie9FJYg1mPGA+Ll9f6eKBEDMXch01VPclRWEKKj4TPCohPq7U6aBMIDOXCb9lTGwCheCHR9PseYe7upNRvmz8= 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=1739176679; x=1770712679; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version:content-transfer-encoding; bh=Zz1jD+AlP6uhp6Py9YnVs2LU7Yks38bT/3C09bVc/cE=; b=V6+Xt1sv1ljhhGVrUIwB88VQtuYzxqNdoIhvt7JwVZoxC3dDeTAGZ5mB A/gLnu5CUCHD+E/Io5TWsmYC2JQqwHZgeUyTNk0OZHZsjAN9VIW+IrY+d zoONthZN7MbsrPo/Ok/1znGV/XlkVySSo5owdlUquYtlyYr6guRheTCb/ uCnktcfpZt1WgyoOoDgfDjRCs28s4oqOf9pO1ugBkj+5UVgGjggC2NV8s CcQGGyYhdz3E+WG/AP9we09DgfrerL8CpOni8BPEYkLZ3MmRs+kimZupa zQ3jHrjKds52aFAqRMMGo77sf8ijlCcZ9xCLR3GTm8XssLFdGjudUdFB6 w==; X-CSE-ConnectionGUID: o//Lq2RURn6Lo8VonBa1Cg== X-CSE-MsgGUID: m0PyCe1bRGaDfOp1HQAMBA== X-IronPort-AV: E=McAfee;i="6700,10204,11340"; a="40015283" X-IronPort-AV: E=Sophos;i="6.13,274,1732608000"; d="scan'208";a="40015283" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa108.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Feb 2025 00:37:58 -0800 X-CSE-ConnectionGUID: DkXBKVNWQtypQzAhWzPoLA== X-CSE-MsgGUID: VMiEVhvlQnmOktTRTxOXjA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.13,274,1732608000"; d="scan'208";a="117186827" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmviesa004.fm.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 10 Feb 2025 00:37:56 -0800 Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) 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; Mon, 10 Feb 2025 00:37:54 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) 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 via Frontend Transport; Mon, 10 Feb 2025 00:37:54 -0800 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (104.47.74.45) by edgegateway.intel.com (134.134.137.100) 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:37:53 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=jegUL6MuE6iZNQf34gCmSOeE+xXGWaZA0SQN0Zn4OzvB2wW809PpjSSQI9ZA0coeVwx4X4KtHFH7H9R30F2/2e2r88om6budJDF+WKPV3AHtJmiEB0yVgeYT4ilbsGJ5prVULzIKB/HT4ThHEoE+CH/zjcPIQahScLRQyVKls8smEAD3c1pUFbg3kedGbXfiLTmCg+SWNIxV0TmzHFOKDaucJq6CXN9VKbe9afW4IRCYq0bRiWvnu05P9flxTqG964z9ezIrgvkE5S+d88XnBJ98j+ErrOIqUsXaE6gBhabAxJ6G3RwUXvMbQmX25CSUD5U6Ti1i3sBkmlvYSS1apw== 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=00l+MhwjozApAyBrML+hsz0SCNFvEZKKTLe7vaakrbk=; b=VRL0IS9GmaAepl61l/dxHnzXqoWaVGaupU5Udr71GU1INmxPq4n81+WFpyflX0j5jaeI3PGXIzEF1EJ+whqFgG3PMLAq6dQabO5t8bX+g8/Q3dVcZr+ZHiBzQoyhd2r+BRkzaPv94wmxCoiu+8m5WnsgeksJKmS6oZVwtCprhTArgJhhfZNjKbQvxA7HeL6XmcZx84sbcMMxZwa7a5GJzHA7yunaTLFC0eRW+tAIEbsaQKbnTXMVu0pubdE6k+Pgk8EITcc+y0UHWFWdPVjlA+X+SZu+yia3Gw0d9wxXH0x1hnos2i+lgfGHm+QhRd2FXbJts6xsyqegttWCjQaPOw== 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 PH7PR11MB6401.namprd11.prod.outlook.com (2603:10b6:510:1fb::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8422.16; Mon, 10 Feb 2025 08:37:51 +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:37:51 +0000 From: "Schimpe, Christina" To: Thiago Jung Bauermann CC: "gdb-patches@sourceware.org" Subject: RE: [PATCH 09/12] gdb, gdbarch: Enable inferior calls for shadow stack support. Thread-Topic: [PATCH 09/12] gdb, gdbarch: Enable inferior calls for shadow stack support. Thread-Index: AQHbUxsT23ff98VWZkCbtnRkCGZMHrM56SMKgAC8V7CAAm+IsYADcSBg Date: Mon, 10 Feb 2025 08:37:51 +0000 Message-ID: References: <20241220200501.324191-1-christina.schimpe@intel.com> <20241220200501.324191-10-christina.schimpe@intel.com> <87tt97hhpf.fsf@linaro.org> <871pw9rsuq.fsf@linaro.org> In-Reply-To: <871pw9rsuq.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_|PH7PR11MB6401:EE_ x-ms-office365-filtering-correlation-id: ecab697f-9806-4d3a-c632-08dd49ae34eb x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|366016|1800799024|376014|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?iBqX+3pLgbjVYV1jHQK3kB8J2FnPM4kWRcK3LTOYkp2YfmKIWrwZoIyAfxhN?= =?us-ascii?Q?MmUKb5xdKrGSzvMM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++?= =?us-ascii?Q?6M0ECENKrnwSuaD8byiG68HldMbgc9Q1JlqIyKu3HCK+zzzSodSEJH9cYx9o?= =?us-ascii?Q?aFyTShj8rfkVXOMYPwplAl95txCkKCXOdxx5LkfIToVz1l9Lg3k3nNZ12wWI?= =?us-ascii?Q?FsrWXMXZ9/nWhxkPuxevHT+B0s1EKUf56TZPBMXV/GPQbX6PYnWkf83KY0cj?= =?us-ascii?Q?n7hWY/5qD/ZQc+2TD0McJTIYcF40lDbNQXlf4+Lc72SPeuQPSTngocAIPQ84?= =?us-ascii?Q?lzRC2CxOMexGvNlnxG+/46J8zTcL2Yy1Hq/6aLcoDauCN0sLGZUs0da9DBV4?= =?us-ascii?Q?CvKjBrIYUXWMJU35dj5tfcwz7OHijNV2TVT+lOwJj3FNKQLVsWdj3SJiMYiR?= =?us-ascii?Q?eSz5j1O3JPuvya2vvp8hOpR1UnIAOlvihrGCuxt+al55g4zmb+fppE6sRoK/?= =?us-ascii?Q?iC3t1SFzyT8tLVP15D0DCQcwIFIZGJ6+X1lX20dZHcrOnVVlFMMfuH6j1Fh8?= =?us-ascii?Q?GpTEpUMxp6UhNXcmTuzZVKS241TuTTDO?= 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)(366016)(1800799024)(376014)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?GagpDYg48rhTB0bALIjvT8cCedAhOWdtf9ZlXeAaAuaiJXcpNpj5uSQgfRbz?= =?us-ascii?Q?cIx6SwTKQvWZYchvOqy04KL+JB9gwVOnonT+kdQuOAdVu3RxKMyKfeUV58xv?= =?us-ascii?Q?sCNFqXLtT+NwTKC8IUh1UOXeBlOhPOrou2pcvB8iChDkD+GovmhXZQYUSoHm?= =?us-ascii?Q?P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enz27F?= =?us-ascii?Q?fNjc0TGobQw1WJwUW3BlLk379QTtMA/6IEY3HgQZjdVcJHAWU4i6pXWO+B2n?= =?us-ascii?Q?A2ccoORk2+4Kyxa/C62CBU91y88D08i74OTEf0c3YFhEkXuMBOaZs5YmLXCC?= =?us-ascii?Q?p3+LBwC09vLZ8RIifNPWPIc9iY27Mj4L3QQ57P0VGwDFD2qIPSWGyB9VFXK2?= =?us-ascii?Q?n3zWpRcFP1iB/1mJ/fIKm2vXbGfo+4YiiIxp3qQvkArUt5dg0Phfw/PhlNCn?= =?us-ascii?Q?pF+ss5LG/gfzCvQZ4pczzqUTYckCZamPi/rdFy5CJjuP8aH3issYkgvRpxnC?= =?us-ascii?Q?W7ws+jYnl8L6gehVPQrtfURjU1IOvxjLLIzArWNaCehT3bF/M9ZY+vfOfywf?= =?us-ascii?Q?jAYE+bzplyiLG3vIUU4O5d9ovAnAUenwZRiUCyhS0ZaWSeTojtcoJ50eoNHt?= =?us-ascii?Q?MHipfGi4sTwAKjOGmERfYWbjluyFRA+z/aHZWwBDa5mLCoQYgX7Qy6sHT2qI?= =?us-ascii?Q?X8kFxX3S0jgr6gTMQvIORZd7rAOlm2QtiMAq/iaaFBN8mh9oA/M+DhiBu1iX?= =?us-ascii?Q?8Q=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: ecab697f-9806-4d3a-c632-08dd49ae34eb X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Feb 2025 08:37:51.6936 (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: kdrH8/rknfvKv8C1uuvbMG34CZl7R6w+v3voFSgJwtKuyHHNjO6O7O2Yp0GJwk1KIX72qmI8hWOLEEI8QkpWulrzpWNZbewWThJdSRDy+qY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR11MB6401 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 4:58 AM > To: Schimpe, Christina > Cc: gdb-patches@sourceware.org > Subject: Re: [PATCH 09/12] gdb, gdbarch: Enable inferior calls for shadow > stack support. > = > = > "Schimpe, Christina" writes: > = > >> -----Original Message----- > >> From: Thiago Jung Bauermann > >> Sent: Thursday, February 6, 2025 4:32 AM > >> To: Schimpe, Christina > >> Cc: gdb-patches@sourceware.org > >> Subject: Re: [PATCH 09/12] gdb, gdbarch: Enable inferior calls for > >> shadow stack support. > >> > >> > >> "Schimpe, Christina" writes: > >> > >> > diff --git a/gdb/infcall.c b/gdb/infcall.c index > >> > 6399278c6ae..3a4f1e35a2f 100644 > >> > --- a/gdb/infcall.c > >> > +++ b/gdb/infcall.c > >> > @@ -1453,6 +1453,12 @@ call_function_by_hand_dummy (struct value > >> *function, > >> > bp_addr, args.size (), args.data (), > >> > sp, return_method, struct_addr); > >> > > >> > + /* Push the return address of the inferior (bp_addr) on the shadow > stack > >> > + and update the shadow stack pointer. As we don't execute a ca= ll > >> > + instruction to start the inferior we need to handle this > >> > + manually. */ if (gdbarch_shadow_stack_push_p (gdbarch)) > >> > + gdbarch_shadow_stack_push (gdbarch, bp_addr); > >> > + > >> > >> For AArch64's Guarded Control Stack, instead of adding a new gdbarch > >> method I added this change to aarch64_push_dummy_call: > >> > >> if (aarch64_gcs_is_enabled (regcache)) > >> aarch64_push_gcs_entry (regcache, bp_addr); > >> > >> To implement aarch64_gcs_is_enabled I did add a new method to > >> aarch64_gdbarch_tdep so that OS-independent code in aarch64-tdep.c > >> could call Linux-specific logic in aarch64-linux-tdep.c: > >> > >> static bool > >> aarch64_gcs_is_enabled (regcache *regs) { > >> gdbarch *arch =3D regs->arch (); > >> aarch64_gdbarch_tdep *tdep =3D gdbarch_tdep > >> (arch); > >> > >> if (tdep->gcs_is_enabled =3D=3D nullptr) > >> return false; > >> > >> return tdep->gcs_is_enabled (regs); } > >> > >> Wouldn't a similar approach work for amd64? > > > > Hi Thiago, > > > > Thank you for the feedback! > > > > I think I could also fix it in amd64_push_dummy_call by implementing > > it in a similar way than you do. > > But isn't it better to keep the code generic ? > > > > Generic code for handling shadow stacks is also required for the > > implementation of "bt shadow", as I tried to provide an implementation > > that can be used by other architectures as well. > = > Yes, that is a good point. I'm on the fence on this one. On the one hand, > there's value in keeping generic code simpler if something can be handled= just > as well by arch-specific code, but also it's good to share code between > architectures. Ok, let's hope for more feedback on this open. = > My suggestion for this gdbarch hook then is that it should also accept a > regcache as argument. call_function_by_hand_dummy already obtains it so > that it can call gdbarch_push_dummy_call, so it avoids another call to > inferior_thread deeper in the stack since the hook implementation will ne= ed it. Good point. This shouldn't be a problem. = 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