From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6XV/ARfYU2gtZhQAWB0awg (envelope-from ) for ; Thu, 19 Jun 2025 05:27:51 -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=TNEk51gj; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=TNEk51gj; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id EE1851E11C; Thu, 19 Jun 2025 05:27:50 -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 1D1111E0C2 for ; Thu, 19 Jun 2025 05:27:50 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CB46A383FAE5 for ; Thu, 19 Jun 2025 09:27:49 +0000 (GMT) Received: from PA4PR04CU001.outbound.protection.outlook.com (mail-francecentralazlp170130007.outbound.protection.outlook.com [IPv6:2a01:111:f403:c20a::7]) by sourceware.org (Postfix) with ESMTPS id EEDD83844178 for ; Thu, 19 Jun 2025 09:27:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EEDD83844178 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 EEDD83844178 Authentication-Results: server2.sourceware.org; arc=pass smtp.remote-ip=2a01:111:f403:c20a::7 ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1750325241; cv=pass; b=T9zCvXGyZO69JhVZP3WLIoAEXz0T2OMjbE4H6sDveeBE+Kvo7kNnIrhg1VZiuUPLzFH5bLu35BZl0Q1JwzO0ebzgIjxwgFkkzdWLeknuOfmVQCgTbWLHoOr1m0Kh8LB0xm832/KKYPBn1/JS0iIL3Vc+hEXP/YeyWvXoXwZrXBs= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1750325241; c=relaxed/simple; bh=zeSC1LwhcI85SQE+7AoBYqyjiAi7iTGfu78NZUs6uzc=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:From:Subject:To: MIME-Version; b=Cs0G2pOG+24m7UcoQTcY3o5yF4dpl17AvmWdJl2+FSr7v1zUz81+hiAMexQfvZa3hWKJHLP0zDx3s2zDOb5PUv0JHEeQo+eYNPvnJAFpY8fqxJQi2WzTR63z2IZKAzmqBuZBgXwKAaZsLRt7DDVrOzqWQm8ncndyNzVdTrw6GAw= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=feUY4vxEJ7ary8d5O1YqbxZtk+HmbrwMuh5wb6zgfoDNJ2ohPG6exJJNHbU8mYegq6jy6Xtk6COYiNKKkjzXStMX7q5WTxvPmGU2fkvEQkI870Ts/Y9Tx+6hFlbFr2sn+izyS2WmBsKHYOPI09v2Sf1xxV3l3rQRwrlEqlBl2tTvGX6ZZ0SoKRCt2e7bJczQSXxK5eeS8KM30Y39ZoiZPB0gJF6TklinOaOctVUoKRIOUpVk1F6BfTr/IrZHY+Y8lcCWoCQ8REtMe4Pr6DEF4tamrk0J2p+8x6Apu2NVM7keKLw2GWre3aZoZSeaIpv4sVsrmSgHimehbpyWq4YdAw== 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=WE7vSKWplDaO3zWpMiWucgXNxOb3llV+MVQyAUhwgCk=; b=SbbYXzwFydod04nssOlQdTIUS7JKWlYdAorKs7SEx1CVmNGevGfZGkZG3HDY5LXIToL8XwFQQzZhjXFZeZDaVrYHKuTZxbSX8Q7oOcEIwZIGmc/cX2gYQcwrSTcfzB24q27jdIH+dIZtHJjj5/2uNMCegGkfKg7W6UwjSfBxk4eCI9j6vr6Oj187dGQ9gvB8NRMTgaRlANf/epSedUqHfa6fN8/IH9NXv2PxNydLiO+ewGN9NYBolwDclrH+GvIo0aMnsP5X+lMEsXqJzrapi8jAWBI668qrHNgdpxLROACnrx8jDnHL2P47gvwEwbpLvPP1q/zopx9+eMSrTb3ZzQ== 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=WE7vSKWplDaO3zWpMiWucgXNxOb3llV+MVQyAUhwgCk=; b=TNEk51gj7mQswLgtl/ZJP8pgQlaBhoSi6UaQ+ebhM1Vz2LZqj9cjEMF2x5RYbgEa3N2nF38KZUnahi4Z0FeDdZ7OEsZFJ99EUZiEYT6nKe5mzrYUwemXqBPSmTSWKHkKtKisFGJECS7not0k4s8sGKCR1UsPI5CuY1D8ZeJohAc= Received: from DUZPR01CA0323.eurprd01.prod.exchangelabs.com (2603:10a6:10:4ba::24) by AM8PR08MB5699.eurprd08.prod.outlook.com (2603:10a6:20b:1d8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8857.19; Thu, 19 Jun 2025 09:27:16 +0000 Received: from DB5PEPF00014B9E.eurprd02.prod.outlook.com (2603:10a6:10:4ba:cafe::96) by DUZPR01CA0323.outlook.office365.com (2603:10a6:10:4ba::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8835.36 via Frontend Transport; Thu, 19 Jun 2025 09:27:14 +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 DB5PEPF00014B9E.mail.protection.outlook.com (10.167.8.171) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8857.21 via Frontend Transport; Thu, 19 Jun 2025 09:27:14 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=FEAe5TGgowfC3O3mVKXl0NXPe05ldWU3H/+sjBl3sYc5yVY0s5u6yP8TetscIcTKDZ4kuPe0mkG4RrtsK+e0+dHdgEh01R1UBX2vZV8UdW2TMblQiw/9MDyX2y17Oibb3dEsvc9kLWbty7MwuJ/4Wa9CQPNeHNm31G5bU+JF9qWGcEGZeSI0CugfRkt8Z8lBcROPUIUTo804m7eaobbDoy3VQclmmDKXN0BlFKvcXWOzBirlmjeknlhBS2jBuNoTQBMThZiR/ukLeTJZ0RWxIt+Ik1JMnOqfFtN1hrdQnpG+j4MAXUeUYzvNL2W2nBUt5N8VFYsCN/X5goxPf3GEsg== 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=WE7vSKWplDaO3zWpMiWucgXNxOb3llV+MVQyAUhwgCk=; b=pm/Th8BbML2DMklWh1cDvtHn6qywR6rErxKB+Q1R3W/1IVhUVZy+G9ViBgnnG3h/nwCt6GRtHOXBx3E70C9gYrOyp+kCyP6BCrUQbEfbGR5FEsBbg4kJpApyL5qKMzbpElLwhvWGMsj7l4tuY93imX8St7sEHZ51LW/afnvPDfd4ekXR21UAa7wvLUnS8YcEW2/watFVL+iKnPqhSQfgSisQcTPnstrZl03A4RxXObaKnXRUKBC+sjvGdv4hDFyWwn7JiU1Mnr+JLhm7dELlC9PRAkB5KMTzW0ocN15K235CvkLU6L1T0YxsPc0b/ytKD4CMjcDk9pNCUilSFKZvWw== 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=WE7vSKWplDaO3zWpMiWucgXNxOb3llV+MVQyAUhwgCk=; b=TNEk51gj7mQswLgtl/ZJP8pgQlaBhoSi6UaQ+ebhM1Vz2LZqj9cjEMF2x5RYbgEa3N2nF38KZUnahi4Z0FeDdZ7OEsZFJ99EUZiEYT6nKe5mzrYUwemXqBPSmTSWKHkKtKisFGJECS7not0k4s8sGKCR1UsPI5CuY1D8ZeJohAc= 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 DB3PR08MB8940.eurprd08.prod.outlook.com (2603:10a6:10:431::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8835.30; Thu, 19 Jun 2025 09:26:42 +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.019; Thu, 19 Jun 2025 09:26:42 +0000 Message-ID: <5c1dfebf-dc18-4193-9542-ab875966d15a@arm.com> Date: Thu, 19 Jun 2025 10:26:41 +0100 User-Agent: Mozilla Thunderbird From: Luis Machado Subject: Re: [PATCH v4 11/11] gdb: Enable displaced stepping with shadow stack on amd64 linux. To: Christina Schimpe , gdb-patches@sourceware.org Cc: thiago.bauermann@linaro.org, eliz@gnu.org References: <20250617121147.1956686-1-christina.schimpe@intel.com> <20250617121147.1956686-12-christina.schimpe@intel.com> Content-Language: en-US In-Reply-To: <20250617121147.1956686-12-christina.schimpe@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0446.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::26) To PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PR3PR08MB5852:EE_|DB3PR08MB8940:EE_|DB5PEPF00014B9E:EE_|AM8PR08MB5699:EE_ X-MS-Office365-Filtering-Correlation-Id: 15877276-42b1-4b3e-f19c-08ddaf137a26 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|376014|366016|1800799024; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?B?ZlZHTUlhUTJ6M21UUm84ZXBBb24zNzY1OUFFSk9qeWFGRlJWQ3Z6ZDBpZFph?= =?utf-8?B?WHBGN0pwMlFVblhIL096K3d0VXdEK2w4TFFFNjJnTzZuTjVpdG1KZ0xGN3Q5?= =?utf-8?B?RDZ1elNkWmcyWnlXQlF1cFYyT2N3MmE3TmxwSEVjZ0lyVkNoU0MxUWFzN3lz?= =?utf-8?B?amh3bit3ZW5uZzRnMzBmZDVaeUNlM2FWejYrS2dRVlBLWDNwUVhIdjZINWtT?= =?utf-8?B?ekIrVWVWUmFUbFN1Tk9xREJtRmpQOTVnVE43MUxadnNVT0ZxUmtqbExOSGl6?= =?utf-8?B?RHBvbHo0bHZEejUrNE5zTnlkU2Q2dDdBSjRPVVFlNnZoSG5GTXlweUJRaS9I?= =?utf-8?B?eTZEVEFVK0tEVXdaUmdsc01nSHF1MG9OSm4ySFZBK053NGR3Y3MwRGpVRDMr?= =?utf-8?B?aC9OZXZBeFdpOUVVR1FoUHFFRzZacUlKOUtGZUFSSE5Kbk96aXhpWUVINzNC?= =?utf-8?B?SS90WGVwSnVMTmw5WUIzQ21uT3dxRFJ0QldGUDhWams4U0M3TnE4L0pGbnIv?= =?utf-8?B?S24wa1dFR2pJeVhSSzV5dzB6dUo3NjFFL3hhVXNSQ1ZuNjJRWTh0ZHc0YXdS?= =?utf-8?B?enlRaGg4cjUvS3krNkR3NXRSbCtpU2FQRm05RG02eCtOekVSekxuWlZydGx3?= =?utf-8?B?K1R6TXJMc25GWFN5SXBoalIrMnViV2JUZ2lYSXlaUmwrVFhRTGZRYlZPYnhw?= =?utf-8?B?cklSUWMxdFNnK3g1Q2M2VFVRd0tnaTZzeUgzZmtEYTB2YXRVNE54L1NMRnh3?= =?utf-8?B?TWRYOXcxMlh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V0pHR2hsd1ZPZ2JHdWg1cjhtMWVmeHFwdGdUaUpERTQxa0RsVUtXa3lwaU5C?= =?utf-8?B?VmFQUExLdC95alkyZVBQSHplZTBIcG9FeWJvVGlIK1RFNzh5Z1BNZWpDVlU5?= =?utf-8?B?eTM0eGF4T2hSSXNYUjUzNW5lVGtjckdDUUw0dnM2dHgrN3oyS3NEQWVWT2ZX?= =?utf-8?B?WFZxUjMwNGY1eHJoc1pPcEZlWXZKOFNxSzhJVDdXOGxYdlNVeVRuT2Mxdldv?= =?utf-8?Q?F4nOxpDKA00=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)(376014)(366016)(1800799024); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR08MB8940 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DB5PEPF00014B9E.eurprd02.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 50a9175e-a1c5-45b3-6936-08ddaf1366b1 X-Microsoft-Antispam: BCL:0; ARA:13230040|14060799003|82310400026|1800799024|35042699022|376014|36860700013; X-Microsoft-Antispam-Message-Info: =?utf-8?B?bkNVUWZDZHA2bVQ3K1YvMVhhVDBPWDY3cUtrK2NncHZUNDRRbUlvQWtBL3RM?= =?utf-8?B?dC8weHU1L0loN2J3blhzNjJUbUZjRTNacmRLbFBhQzA4YzhHQU5xVi82WEJ3?= =?utf-8?B?TUxCSGFZYjVYZ1ZrSlJQdkxzVFA5TGVCcjlNVkU5UEFWQ1dzOUZTZTBVckdH?= =?utf-8?B?bHpLSm9ZMm9kZ1llL1dGWUtrWjJYODVlRVZzWHdpK3QzVXU2UnAxWGxZblF4?= =?utf-8?B?TDZKdE4wL0tMVEt0VDZLVnRlYTRD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HF3bWYxS3lGM1JF?= =?utf-8?B?ODdkZXoxam5waU8zbXNsWXZYcjJRdXhBRkVtQT09?= 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)(14060799003)(82310400026)(1800799024)(35042699022)(376014)(36860700013); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2025 09:27:14.2047 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 15877276-42b1-4b3e-f19c-08ddaf137a26 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: DB5PEPF00014B9E.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB5699 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/17/25 13:11, Christina Schimpe wrote: > This patch enables displaced stepping to support Intel's Control-Flow > Enforcement Technology (CET), which provides the shadow stack feature > for the x86 architecture. > Following the restriction of the linux kernel, enable displaced stepping > for amd64 only. > > If displaced stepping is active and the single stepped instruction is a > call instruction, the return address atop the stack is the address following > the copied instruction. However, to allow normal program execution it has > to be the address following the original instruction. Due to that reason, > the return address is corrected in amd64_displaced_step_fixup and > i386_displaced_step_fixup. I thought the description was slightly confusing. The above is the original behavior, right? > > To avoid a control-protection exception if shadow stack is active, > the shadow stack top address must be corrected as well. And this one is the new behavior? Might make sense to clarify it. > > Reviewed-By: Eli Zaretskii > --- > gdb/NEWS | 3 + > gdb/amd64-linux-tdep.c | 16 +++- > gdb/amd64-tdep.c | 15 ++++ > gdb/doc/gdb.texinfo | 11 ++- > gdb/i386-tdep.c | 15 ++++ > .../gdb.arch/amd64-shadow-stack-disp-step.exp | 90 +++++++++++++++++++ > 6 files changed, 147 insertions(+), 3 deletions(-) > create mode 100644 gdb/testsuite/gdb.arch/amd64-shadow-stack-disp-step.exp > > diff --git a/gdb/NEWS b/gdb/NEWS > index b8fb7f0e484..15d2772230e 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -3,6 +3,9 @@ > > *** Changes since GDB 16 > > +* Debugging Linux programs that use x86-64 or x86-64 with 32-bit pointer > + size (X32) Shadow Stacks are now supported. Should we mention CET somewhere? > + > * Support for the shadow stack pointer register on x86-64 or x86-64 with > 32-bit pointer size (X32) GNU/Linux. > > diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c > index d847248659a..f989cfb3bf8 100644 > --- a/gdb/amd64-linux-tdep.c > +++ b/gdb/amd64-linux-tdep.c > @@ -1935,8 +1935,10 @@ amd64_linux_shadow_stack_element_size_aligned (gdbarch *gdbarch) > possible. */ > > static std::optional > -amd64_linux_get_shadow_stack_pointer (gdbarch *gdbarch, regcache *regcache) > +amd64_linux_get_shadow_stack_pointer (gdbarch *gdbarch, regcache *regcache, > + bool &shadow_stack_enabled) > { > + shadow_stack_enabled = false; > const i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > > if (tdep == nullptr || tdep->ssp_regnum < 0) > @@ -1954,6 +1956,9 @@ amd64_linux_get_shadow_stack_pointer (gdbarch *gdbarch, regcache *regcache) > if (ssp == 0x0) > return {}; > > + /* In case there is a shadow stack pointer available which is non-null, > + the shadow stack feature is enabled. */ > + shadow_stack_enabled = true; > return ssp; > } > > @@ -1964,8 +1969,13 @@ static void > amd64_linux_shadow_stack_push (gdbarch *gdbarch, CORE_ADDR new_addr, > regcache *regcache) > { > + bool shadow_stack_enabled; > std::optional ssp > - = amd64_linux_get_shadow_stack_pointer (gdbarch, regcache); > + = amd64_linux_get_shadow_stack_pointer (gdbarch, regcache, > + shadow_stack_enabled); > + > + /* It's enough to check if SSP is valid as for amd64 linux shadow stack > + is always enabled if SSP has a value. */ Is my understanding correct that for amd64's shadow stack support, whenever SSP has a value, then shadow stack is enabled? If so, maybe rephrase it as... "For amd64/Linux, if SSP has a value that means shadow stack is enabled." What do you think? > if (!ssp.has_value ()) > return; > > @@ -2121,6 +2131,8 @@ amd64_linux_init_abi_common(struct gdbarch_info info, struct gdbarch *gdbarch, > (gdbarch, amd64_linux_remove_non_address_bits_watchpoint); > > set_gdbarch_shadow_stack_push (gdbarch, amd64_linux_shadow_stack_push); > + set_gdbarch_get_shadow_stack_pointer (gdbarch, > + amd64_linux_get_shadow_stack_pointer); > dwarf2_frame_set_init_reg (gdbarch, amd64_init_reg); > } > > diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c > index 79f7e427841..6c54957ae75 100644 > --- a/gdb/amd64-tdep.c > +++ b/gdb/amd64-tdep.c > @@ -1917,6 +1917,21 @@ amd64_displaced_step_fixup (struct gdbarch *gdbarch, > displaced_debug_printf ("relocated return addr at %s to %s", > paddress (gdbarch, rsp), > paddress (gdbarch, retaddr)); > + > + /* If shadow stack is enabled, we need to correct the return address > + on the shadow stack too. */ > + bool shadow_stack_enabled; > + std::optional ssp > + = gdbarch_get_shadow_stack_pointer (gdbarch, regs, > + shadow_stack_enabled); > + if (ssp.has_value () && shadow_stack_enabled) > + { > + write_memory_unsigned_integer (*ssp, retaddr_len, byte_order, > + retaddr); > + displaced_debug_printf ("relocated shadow stack return addr at %s " > + "to %s", paddress (gdbarch, *ssp), > + paddress (gdbarch, retaddr)); > + } > } > } > > diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo > index cf152bd1e6f..589fd50345f 100644 > --- a/gdb/doc/gdb.texinfo > +++ b/gdb/doc/gdb.texinfo > @@ -27055,12 +27055,20 @@ the program stream must be an @code{ENDBR} instruction, otherwise the > processor signals a control protection exception. > @end itemize > > -Impact on Call/Print: > +Impact on GDB commands: > +@itemize @bullet > +@item Call/Print: > Inferior calls in @value{GDBN} reset the current PC to the beginning of the > function that is called. No call instruction is executed, but the @code{RET} > instruction actually is. To avoid a control protection exception due to the > missing return address on the shadow stack, @value{GDBN} pushes the new return > address to the shadow stack and updates the shadow stack pointer. > +@item Step: > +With displaced stepping, @value{GDBN} may run an out of line copy of a call > +instruction. In this case, the wrong return address is pushed on the shadow s/pushed on/pushed to > +stack. @value{GDBN} corrects this value to avoid a control protection > +exception. For more details on displaced stepping, see @ref{displaced-stepping}. > +@end itemize > > @node Alpha > @subsection Alpha > @@ -41736,6 +41744,7 @@ GLOBAL Disassembler_2 (Matches current architecture) > @cindex out-of-line single-stepping > @item set displaced-stepping > @itemx show displaced-stepping > +@anchor{displaced-stepping} > Control whether or not @value{GDBN} will do @dfn{displaced stepping} > if the target supports it. Displaced stepping is a way to single-step > over breakpoints without removing them from the inferior, by executing > diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c > index f3fa4e511e6..d83fdc0c85e 100644 > --- a/gdb/i386-tdep.c > +++ b/gdb/i386-tdep.c > @@ -899,6 +899,21 @@ i386_displaced_step_fixup (struct gdbarch *gdbarch, > displaced_debug_printf ("relocated return addr at %s to %s", > paddress (gdbarch, esp), > paddress (gdbarch, retaddr)); > + > + /* If shadow stack is enabled, we need to correct the return address > + on the shadow stack too. */ > + bool shadow_stack_enabled; > + std::optional ssp > + = gdbarch_get_shadow_stack_pointer (gdbarch, regs, > + shadow_stack_enabled); > + if (ssp.has_value () && shadow_stack_enabled) > + { > + write_memory_unsigned_integer (*ssp, retaddr_len, byte_order, > + retaddr); > + displaced_debug_printf ("relocated shadow stack return addr at %s " > + "to %s", paddress (gdbarch, *ssp), > + paddress (gdbarch, retaddr)); > + } > } > } > > diff --git a/gdb/testsuite/gdb.arch/amd64-shadow-stack-disp-step.exp b/gdb/testsuite/gdb.arch/amd64-shadow-stack-disp-step.exp > new file mode 100644 > index 00000000000..b5f168c2c42 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/amd64-shadow-stack-disp-step.exp > @@ -0,0 +1,90 @@ > +# Copyright 2024 Free Software Foundation, Inc. s/2024/2025 > + > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program. If not, see . > + > +# Test continue from call instructions with shadow stack and displaced > +# stepping being enabled. > + > +require allow_ssp_tests support_displaced_stepping > + > +standard_testfile amd64-shadow-stack.c > + > +save_vars { ::env(GLIBC_TUNABLES) } { > + > + append_environment GLIBC_TUNABLES "glibc.cpu.hwcaps" "SHSTK" > + > + if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile} \ > + additional_flags="-fcf-protection=return"] } { > + return -1 > + } > + > + # Enable displaced stepping. > + gdb_test_no_output "set displaced-stepping on" > + gdb_test "show displaced-stepping" ".* displaced stepping .* is on.*" > + > + if { ![runto_main] } { > + return -1 > + } > + > + # Get the address of the call1 instruction. > + set call1_addr -1 > + gdb_test_multiple "disassemble main" "" { > + -re -wrap "($hex) <\\+($decimal)>:\\s*call\\s*0x.*.*" { > + set call1_addr $expect_out(1,string) > + pass $gdb_test_name > + } > + } > + > + if { $call1_addr == -1 } { > + return -1 > + } > + > + # Get the address of the call2 instruction. > + set call2_addr -1 > + gdb_test_multiple "disassemble call1" "" { > + -re -wrap "($hex) <\\+($decimal)>:\\s*call\\s*0x.*.*" { > + set call2_addr $expect_out(1,string) > + pass $gdb_test_name > + } > + } > + > + if { $call2_addr == -1 } { > + return -1 > + } > + > + gdb_test "break *$call1_addr" \ > + "Breakpoint $decimal at $hex.*" \ > + "break at the address of the call1 instruction" > + > + gdb_test "break *$call2_addr" \ > + "Breakpoint $decimal at $hex.*" \ > + "break at the address of the call2 instruction" > + > + # We only resume until call1 instruction in case the first instruction > + # we're stopped at is not yet the call1 instruction. > + set stop_addr [get_valueof "/x" "\$pc" "" "value of pc after runto_main"] > + if {[eval expr "$stop_addr < $call1_addr"]} { > + gdb_test "continue" \ > + "Breakpoint $decimal, $call1_addr in main ().*" \ > + "continue until call1 instruction" > + } It was particularly clear why we need the check above. Is this due to how the compiler might generate code and then we could risk stopping at the instruction we're interested in when we "run to main"? > + gdb_assert {$call1_addr == [get_valueof "/x" "\$pc" ""]} > + > + # Test continue from breakpoint at call1 and call2 instructions. > + gdb_test "continue" \ > + "Breakpoint $decimal, $call2_addr in call1 ().*" \ > + "continue from call1 instruction" > + > + gdb_continue_to_end "continue from call2 instruction" > +} Reviewed-By: Luis Machado