From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id rDDXN7FtWWgRxBoAWB0awg (envelope-from ) for ; Mon, 23 Jun 2025 11:07:29 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=coU5DdNN; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=coU5DdNN; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D330E1E11C; Mon, 23 Jun 2025 11:07:29 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-9.1 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE autolearn=ham autolearn_force=no version=4.0.1 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 915B31E0C2 for ; Mon, 23 Jun 2025 11:07:28 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3CA953868F51 for ; Mon, 23 Jun 2025 15:07:28 +0000 (GMT) Received: from DUZPR83CU001.outbound.protection.outlook.com (mail-northeuropeazlp170120005.outbound.protection.outlook.com [IPv6:2a01:111:f403:c200::5]) by sourceware.org (Postfix) with ESMTPS id 6BCBE3860C3A for ; Mon, 23 Jun 2025 15:07:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6BCBE3860C3A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6BCBE3860C3A Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c200::5 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1750691225; cv=pass; b=fqalzqdwQTJDx22v3Q5w9xZT+AneYMeBPlKDGTOo5EPAkVWBE5HS2OXR/J9ksVgmEgJ/pLZhoo3G882Ugat7AVJDgpqCXXkBcPzzo/MxiC6puGvgE2NvymlHz7I4IYsXK3kuJMn4AmVnQHibpJfVqcKuB6sr0ugxBAQjf/CwRAw= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1750691225; c=relaxed/simple; bh=NzREn3BrkxL4kTUml6Z/pZxHuH9tzNk6azEHO6jhkGs=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=o9q4+mu2DvA9Un8UKMBYFpyxfqRRYBzzMa4esC1/VmypYqjBGR60BayFx8WRjFkp1CDcV1qrzzxWxvoln4zAP4u5sA50GBA7SUUlIi5hIsTc+cJmRbhtwQVwLJ+8pcJTB3xV7UK2fc9LrjgWOnTEGcDtgjbzTNc0RF0o1ZpyHi8= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=FYEFZsLBNlLEdwt0BuDVeAP1/ux3XaWmwsfwRBcSvA8BhzT7VBluuQTs/DTlmwfOIyvYFGVVJV/qXypNDsBD+cMN24tsqBW4FFsIEiq+87+QHvNrOUJAdE+pYsLd5/zPfEamboV9cThdgvnRDGZfSlQtEQX063flrVQ+obYQ3STr5wp8lYvHB5AfWS//kJFTp6kMOR2Au13UxJD6264SSZTGbpPLcs+tGbdbgkhRke3X0csIEVZ/lg0GFnDKnN2cVu3mBnq3XZmPCQgUOFvhHeykanxAU0VWPqu9NbGSdy9GDZ3P/BxRUNxsy4Pjy2GwXWNk7IiT0oRaB/x7WoghmQ== ARC-Message-Signature: i=2; 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=g8+IBp2NOusxSAnzcSq+cBUh8k2b620m0+bMTVPnHTk=; b=Ov4/sZhPFwsS7wFDL+BZ7HwjWgNRIO1gFDH0VfXaEoQzW9I13t6/DWGgY5XCd2UR+6Aopid6wx2K12B8lTeoG+Bsq3fy5rtZXcgRHIxKKrZmB1WGbDQAAhKbjKWQEqLgz1NKptiq97wiVx5YjS5UDwb9N7CkekUn+UIvd7NWHb2qd7H+6JjfAkTyha3eNlElxHpHRlm4rQjusSMrACKjXiEvLsmvCqQesQnsH7bYWS73FlZro6B9LOj2Z1xlgu7gYDjdq4b5OuOlS8uZ3CbD0RF6bqBYNQdbd7vzR5mvB4B5GaP1c2F9Q+KJUGXiKonOqUTd3cAWa/Dgo8Cfk62d+g== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 4.158.2.129) smtp.rcpttodomain=intel.com smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g8+IBp2NOusxSAnzcSq+cBUh8k2b620m0+bMTVPnHTk=; b=coU5DdNNXecMFjIZan1WInVZWUd6sxVHaPVAune9H55nM1Fv6r0xLenxLaI0kBgPJAGRv0NsRcucj2HO5wMfQyP140S2NBmOIiDgJ6SIX14jSpVhR/kXsFTEB99OZW7PmOrXG9UT0BLiDHchNV5c5JVsdf7KuVq+sehgXj9b0Ic= Received: from DU2PR04CA0020.eurprd04.prod.outlook.com (2603:10a6:10:3b::25) by AS2PR08MB9125.eurprd08.prod.outlook.com (2603:10a6:20b:5e5::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8857.29; Mon, 23 Jun 2025 15:07:02 +0000 Received: from DB1PEPF000509E3.eurprd03.prod.outlook.com (2603:10a6:10:3b:cafe::39) by DU2PR04CA0020.outlook.office365.com (2603:10a6:10:3b::25) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8857.29 via Frontend Transport; Mon, 23 Jun 2025 15:07:01 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 4.158.2.129) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=arm.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 4.158.2.129 as permitted sender) receiver=protection.outlook.com; client-ip=4.158.2.129; helo=outbound-uk1.az.dlp.m.darktrace.com; pr=C Received: from outbound-uk1.az.dlp.m.darktrace.com (4.158.2.129) by DB1PEPF000509E3.mail.protection.outlook.com (10.167.242.53) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8857.21 via Frontend Transport; Mon, 23 Jun 2025 15:07:01 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L/rs685EFRu6C3hMZSoAUt+Ws1yqWXZTzYMNkrc6uVaJ4nQ19HhAcVDKR3JPiScHbuNU4Rx4xywdk/iviH+fJQtRkeqBk3lVPzrr0PSJH6StdT3uE9keU3z1l2dJjRRgMWbRAkATP1g7AfPhe+7jW1dhk+35VO9KCH27/5kwtUSJq9Yh62VuAUzIapWjgke2qvVrKrQvuOq2tp1WUpUCgFFkOiqiNWSc2ygBtYSAc9d96fN/BSc2/dL6024SCadtgrpl633vzzVEbDFhvjApURhlnPqiEZpzQmre2G3Gjh0tAJ7pSeLZ5eKVdv1qYLn8TSyUsme+yMrEUrGwWaYOcg== 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=g8+IBp2NOusxSAnzcSq+cBUh8k2b620m0+bMTVPnHTk=; b=RCwGCs7Mwvk/zow/rq3v3rS5bcv3WOI73ZZg5xI594iMKUwE12WxJnOPE9Cok1a4YbiRB8iX2+c7ttEtoUOgWIENtzjzjckvsVeeEf5Pok6vw/tWBqkVQp4C66VqFFJ4QZDgNGdu+UG3JoLh2spqDS3d97ITjZfek+mSKjk+Rl6BssmG3dJEXBV0U4OdKfxxw3Ao7dpT45iGF0YBNouIFCYFQK70r9i0Q/XVkXuWb9KhpVNE6cpW8ZUowcPbRfgrCDACHmOM47P1zw7Inlv2qIZR+1wZae8bDx2jW9qzv3WBVMZoCWX/Np2EdANVfqWIOiHceveCcBtrWbOI26/png== 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=arm.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=g8+IBp2NOusxSAnzcSq+cBUh8k2b620m0+bMTVPnHTk=; b=coU5DdNNXecMFjIZan1WInVZWUd6sxVHaPVAune9H55nM1Fv6r0xLenxLaI0kBgPJAGRv0NsRcucj2HO5wMfQyP140S2NBmOIiDgJ6SIX14jSpVhR/kXsFTEB99OZW7PmOrXG9UT0BLiDHchNV5c5JVsdf7KuVq+sehgXj9b0Ic= Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) by VI1PR08MB10175.eurprd08.prod.outlook.com (2603:10a6:800:1cf::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8857.28; Mon, 23 Jun 2025 15:06:28 +0000 Received: from PR3PR08MB5852.eurprd08.prod.outlook.com ([fe80::f44:d113:1c29:825d]) by PR3PR08MB5852.eurprd08.prod.outlook.com ([fe80::f44:d113:1c29:825d%6]) with mapi id 15.20.8857.025; Mon, 23 Jun 2025 15:06:28 +0000 Message-ID: <81a32c0a-d9a5-4a58-a6ac-eb8cdb498ada@arm.com> Date: Mon, 23 Jun 2025 16:06:27 +0100 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 07/11] gdb: Handle shadow stack pointer register unwinding for amd64 linux. Content-Language: en-US To: "Schimpe, Christina" , "gdb-patches@sourceware.org" Cc: "thiago.bauermann@linaro.org" , "eliz@gnu.org" References: <20250617121147.1956686-1-christina.schimpe@intel.com> <20250617121147.1956686-8-christina.schimpe@intel.com> From: Luis Machado In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO3P123CA0025.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:388::14) To PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PR3PR08MB5852:EE_|VI1PR08MB10175:EE_|DB1PEPF000509E3:EE_|AS2PR08MB9125:EE_ X-MS-Office365-Filtering-Correlation-Id: 614acbb8-3f02-41fd-51bb-08ddb2679b2d x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; ARA:13230040|1800799024|376014|366016|7053199007; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?B?T3NNeVlJWU04WnJNVEhmbkN0MTEyZFluYlVwd2c5OWp6V1ZQOFR6SHlGczh2?= =?utf-8?B?dElWSGFMMm5ESkF0MnBjOGxSeWpTVUd2ZE9jK3RhMXZ2UGhYZlp5aG95OGxD?= =?utf-8?B?VDQ1OFJsZVlOWkhSQXZUa25LZFZNRGllMFdINDNPcjArS3dMSVFOVE56cEVY?= =?utf-8?B?QmZJY3BBTzE5RWVCb3B5MHMrOGJtcG9nMTNxSEEwZU9oWWVDNVQ0UzRJdFFF?= =?utf-8?B?SjhwU0hhYXNMR2Z4NVNNZklGQzBjbWY4TDY2V2pmMDFSNlFiSFRVeGNBYnJU?= =?utf-8?B?M0pGY2Z0Q3RkeFJSOW1TSExjcnNsOU5SaXEwcFpCTXA0cDJYNldVenFaTGJQ?= =?utf-8?B?T09aSGp6dWl0c0RXQTdycitrc3J1SU14UG1wQzE5VGtXRkRaaVJCOGcxTXdG?= =?utf-8?B?QkM1Sll2Qm9nOTk3dWJjNnVWVFArN0lNSEZwQTV1bVY2WEoyZmwyWU1qazNK?= =?utf-8?B?UTBxaGI4KzZMVmVYZlhlT1JIaENDbm91MXFROGVNVXJObDdEK3MwbUVSeTJo?= =?utf-8?B?S1Urb21vanVaSHFRaWVabDY1TjBZMjZIaUJVdzdqTVNEYlUzcUZvNkt6end3?= =?utf-8?B?YnJ6ZFZuMHV2eElhOW9Nc2NvalVVUW5xY1pNUnlLcGEyc2t4ZTRtekJEUUs1?= =?utf-8?B?MWp2Nk4rVWpxcElCUTczMitZSDdSTFZ2ZG9xRWpRMzMrcHJXc2R0QlB1UDFq?= =?utf-8?B?L0cxa3VRVThISTdjdWpaeGZma2tMOWo3TnlZa2Q2aS9zR2pmZ0lobmV3YkJR?= =?utf-8?B?QndIVThudStaVjFVN3Q1a2c0RlF1Vlh6Z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JsZjd5bzBzVVZCQk5WOXNodmxwU29LSURIYXJwR3RZbTZ3?= =?utf-8?B?WWxhMm1QK0dBbE9NNGFWQlBSQXZGdmUvNUhJMXYyZi8xMmRMWFlyZnQxV0Fh?= =?utf-8?Q?CBOcZ21ffg25TX/ha6y+qqpJlLOhHUkyCSHss=3D?= X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PR3PR08MB5852.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(1800799024)(376014)(366016)(7053199007); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB10175 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB1PEPF000509E3.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: eaff5bc8-7b80-4297-5a59-08ddb26787b3 X-Microsoft-Antispam: BCL:0; ARA:13230040|1800799024|36860700013|376014|82310400026|14060799003|35042699022|7053199007; X-Microsoft-Antispam-Message-Info: =?utf-8?B?OUFPNUh0VTdpODVmRVlIU2t2NmtWaUlGRElHTlk1VktYZ0RySk0yODZMZWtt?= =?utf-8?B?UmlVQ1k2b3MvM2k2bEhHdW5FYmZOYmdXbTBFdDk1ZWdUOU1nVEx5U1Nmemp6?= =?utf-8?B?ZGtJejNxM1F4ZFN0ZENIaGQyWVpUbk5yK2wzREZkMGw1dklpL2dQdWxiL1dW?= =?utf-8?B?WGpWbkRvM3o1UnliVWsybjVBY3ZMbWQrb1VvYk9LNFVMUW5ranRBSWlWZnU0?= =?utf-8?B?OGI3RjBjcVJQOWh3TDJYa2pEL09vNmliRHQ0UGI4eFNXQW1JZVBuZ0w2YlI3?= =?utf-8?B?Zy9oU2JUZXIwTTM4NUJQQ0R3SGlIWGpLVTJRME9BMEpaaGR5Qk0xb2dVTzJQ?= =?utf-8?B?S3R1ek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= =?utf-8?B?ODhadDYwaXFobk00WU4veUR4N0hxeGdGNG94WkZDYzluSnFyOG1rRU1ZRVYr?= =?utf-8?B?Y1V6SFJieXpTemYvQW8zMzA5Q0wwVUZCME04T0pML21sWllKRVZmcjZTYk9r?= =?utf-8?B?SVNFaVhqckFYUE11REJucDNIaEpXS2duRVVDK2hjR2UvK1AwaFN6a05VSFl3?= =?utf-8?B?dkViRERLTnc5S1hvK1h2Rjg4QU1jSEFpcjNTS2dieDZUMjBtTXpaa3JDeTRU?= =?utf-8?B?cE9LK2VOcm5kSmJKWXVqa0xmRzNCQVlVSjhYNHBldkVVbllGZFIxSyt2a0Mx?= =?utf-8?B?b2xMNnV3am1zM1NFLzlrLysvaEJYTE9KU1pVbzlRVmE4WVIrS0R4M1FCbzNu?= =?utf-8?B?WXFtR1VZY2cxYlBNcjdRUXAzZEI2c3BIdEJpVC9DeXYxTW5ZVThOUUI0TVhp?= =?utf-8?B?Ky9WU29UOVZ6alhTMjJIUDRxa0RjdW4rVmkvMFRpOXBKM3NSRmFKRjhYU0V0?= =?utf-8?B?OUo2RDhJRS96cE5pMDJ4cFdxMSt2c0FFSnZKVWJ0MTcvaFowU2piZkxpTHpR?= =?utf-8?B?eTVLTGlCNkJhUFZvL3ZOMkVKTGxDZDd5MlpLc2lOa3QzRVFwb3VaTSt3OStp?= =?utf-8?B?NU5xVUtiWmd5ZDFRVzNNRWk4OU9NU2ZzL0lMYzU2TFZEVzRuZi9ya3dZQkVs?= =?utf-8?B?b2hIRHhSYjVmamxqQy80SVRLdlZ1NVBRbWFLNmo3b09IOGZyUlFuVlB1WEx0?= =?utf-8?B?RHJpL2ZabFlnPT0=?= X-Forefront-Antispam-Report: CIP:4.158.2.129; CTRY:GB; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:outbound-uk1.az.dlp.m.darktrace.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230040)(1800799024)(36860700013)(376014)(82310400026)(14060799003)(35042699022)(7053199007); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jun 2025 15:07:01.0222 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 614acbb8-3f02-41fd-51bb-08ddb2679b2d X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[4.158.2.129]; Helo=[outbound-uk1.az.dlp.m.darktrace.com] X-MS-Exchange-CrossTenant-AuthSource: DB1PEPF000509E3.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB9125 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 On 6/23/25 16:00, Schimpe, Christina wrote: > Hi Luis, > > Thanks for the feedback. Please find my comments below. > >> -----Original Message----- >> From: Luis Machado >> Sent: Thursday, June 19, 2025 11:25 AM >> To: Schimpe, Christina ; gdb- >> patches@sourceware.org >> Cc: thiago.bauermann@linaro.org; eliz@gnu.org >> Subject: Re: [PATCH v4 07/11] gdb: Handle shadow stack pointer register >> unwinding for amd64 linux. >> >> On 6/17/25 13:11, Christina Schimpe wrote: >>> Unwind the $pl3_ssp register. >>> We now have an updated value for the shadow stack pointer when moving >>> up or down the frame level. Note that $pl3_ssp can become unavailable >>> when moving to a frame before the shadow stack enablement. In the >>> example below, shadow stack is enabled in the function 'call1'. Thus, >>> when moving to a frame level above the function, $pl3_ssp will become >>> unavaiable. >>> Following the restriction of the linux kernel, implement the unwinding >>> for amd64 linux only. >>> >>> Before this patch: >>> ~~~ >>> Breakpoint 1, call2 (j=3) at sample.c:44 >>> 44 return 42; >>> (gdb) p $pl3_ssp >>> $1 = (void *) 0x7ffff79ffff8 >>> (gdb) up >>> 55 call2 (3); >>> (gdb) p $pl3_ssp >>> $2 = (void *) 0x7ffff79ffff8 >>> (gdb) up >>> 68 call1 (43); >>> (gdb) p $pl3_ssp >>> $3 = (void *) 0x7ffff79ffff8 >>> ~~~ >>> >>> After this patch: >>> ~~~ >>> Breakpoint 1, call2 (j=3) at sample.c:44 >>> 44 return 42; >>> (gdb) p $pl3_ssp >>> $1 = (void *) 0x7ffff79ffff8 >>> (gdb) up >>> 55 call2 (3); >>> (gdb) p $pl3_ssp >>> $2 = (void *) 0x7ffff7a00000 >>> (gdb) up >>> 68 call1 (43i); >>> (gdb) p $pl3_ssp >>> $3 = >>> ~~~ >>> >>> As we now have an updated value for each selected frame, the return >>> command is now enabled for shadow stack enabled programs, too. >>> >>> We therefore add a test for the return command and shadow stack >>> support, and for an updated shadow stack pointer after a frame level change. >>> >>> Reviewed-by: Thiago Jung Bauermann >>> --- >>> gdb/amd64-linux-tdep.c | 84 ++++++++++++++++++ >>> gdb/linux-tdep.c | 47 ++++++++++ >>> gdb/linux-tdep.h | 7 ++ >>> .../gdb.arch/amd64-shadow-stack-cmds.exp | 88 +++++++++++++++++++ >>> gdb/testsuite/gdb.arch/amd64-shadow-stack.c | 13 +++ >>> 5 files changed, 239 insertions(+) >>> create mode 100644 gdb/testsuite/gdb.arch/amd64-shadow-stack-cmds.exp >>> >>> diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index >>> d806d3cb1f7..9436f0b190c 100644 >>> --- a/gdb/amd64-linux-tdep.c >>> +++ b/gdb/amd64-linux-tdep.c >>> @@ -47,6 +47,8 @@ >>> #include "arch/amd64-linux-tdesc.h" >>> #include "inferior.h" >>> #include "x86-tdep.h" >>> +#include "dwarf2/frame.h" >>> +#include "frame-unwind.h" >>> >>> /* The syscall's XML filename for i386. */ #define >>> XML_SYSCALL_FILENAME_AMD64 "syscalls/amd64-linux.xml" >>> @@ -1917,6 +1919,87 @@ amd64_linux_get_tls_dtv_addr (struct gdbarch >> *gdbarch, ptid_t ptid, >>> return dtv_addr; >>> } >>> >>> +/* Return the number of bytes required to update the shadow stack pointer >>> + by one element. For x32 the shadow stack elements are still 64-bit >>> + aligned. Thus, gdbarch_addr_bit cannot be used to compute the new >>> + stack pointer. */ >>> + >>> +static inline int >>> +amd64_linux_shadow_stack_element_size_aligned (gdbarch *gdbarch) { >>> + const bfd_arch_info *binfo = gdbarch_bfd_arch_info (gdbarch); >>> + return (binfo->bits_per_word / binfo->bits_per_byte); } >>> + >>> + >>> +/* Implement shadow stack pointer unwinding. For each new shadow stack >>> + pointer check if its address is still in the shadow stack memory range. >>> + If it's outside the range set the returned value to unavailable, >>> + otherwise return a value containing the new shadow stack pointer. >>> +*/ >>> + >>> +static value * >>> +amd64_linux_dwarf2_prev_ssp (const frame_info_ptr &this_frame, >>> + void **this_cache, int regnum) { >>> + value *v = frame_unwind_got_register (this_frame, regnum, regnum); >>> + gdb_assert (v != nullptr); >>> + >>> + gdbarch *gdbarch = get_frame_arch (this_frame); >>> + >>> + if (v->entirely_available () && !v->optimized_out ()) >>> + { >>> + int size = register_size (gdbarch, regnum); >>> + bfd_endian byte_order = gdbarch_byte_order (gdbarch); >>> + CORE_ADDR ssp = extract_unsigned_integer (v->contents_all ().data (), >>> + size, byte_order); >>> + >>> + /* Starting with v6.6., the Linux kernel supports CET shadow stack. >> >> Same typo as before, period after "v6.6". > > Will fix. > >> >>> + Using /proc/PID/smaps we can only check if the current shadow >>> + stack pointer SSP points to shadow stack memory. Only if this is >>> + the case a valid previous shadow stack pointer can be >>> + calculated. */ >>> + std::pair range; >>> + if (linux_address_in_shadow_stack_mem_range (ssp, &range)) >>> + { >>> + /* The shadow stack grows downwards. To compute the previous >>> + shadow stack pointer, we need to increment SSP. */ >>> + CORE_ADDR new_ssp >>> + = ssp + amd64_linux_shadow_stack_element_size_aligned (gdbarch); >>> + >>> + /* If NEW_SSP points to the end of or before (<=) the current >>> + shadow stack memory range we consider NEW_SSP as valid (but >>> + empty). */ >> >> I couldn't quite understand the difference between the empty case and the >> unavailable case. But maybe I just don't fully understand the feature. >> >> Would it be possible to make the comment a bit more clear? > > Is this a bit clearer? > > "There can be scenarios where we have a shadow stack pointer but the shadow stack > is empty, as no call instruction has been executed yet. If NEW_SSP points to the end > of or before (<=) the current shadow stack memory range we consider NEW_SSP as > valid (but empty). " Yes, that clear it up. Thanks! > > Please also see my answer to Thiago: > https://sourceware.org/pipermail/gdb-patches/2025-June/218908.html Thanks. It would be nice if both series were consistent in this regard (<= or <).