From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iKSDNiXYU2gtZhQAWB0awg (envelope-from ) for ; Thu, 19 Jun 2025 05:28:05 -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=OhkWqVFR; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=OhkWqVFR; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D46241E11C; Thu, 19 Jun 2025 05:28:05 -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 BA28B1E0C2 for ; Thu, 19 Jun 2025 05:28:04 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5E096386E155 for ; Thu, 19 Jun 2025 09:28:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E096386E155 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=OhkWqVFR; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=selector1 header.b=OhkWqVFR 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 9B58F386D2FB for ; Thu, 19 Jun 2025 09:25:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9B58F386D2FB 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 9B58F386D2FB 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=1750325106; cv=pass; b=bvBbrrLfQZ2rvGGEcqnQ3vkZgtFltdp45fqoDPhaoaopVmON1EmxObLWyJDEKSwzfrZkqDgdC1B5uSjG+EP2wBh77HKUn4uZtlKuuuEtI+Dd1JULB7ibLKO4fAhpA3+sfJxrTfymX6r3vyJHgMActI9/MY29igrOp3u4Zz4CXcI= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1750325106; c=relaxed/simple; bh=/KQP3gFJyhFNQPTPjmYdwMrd96/dtnZWY2XuIBkPSe0=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:From:Subject:To: MIME-Version; b=MymDB4F7neYXkj5QLp71W9xEJ8PeGiyG86pcvpcsmnOYI4xjgme9EG8mMUIMSqZ86hFaL21XYZdMQ2cdDXvWXZ2oNmiEEes/A6UWD3kXG11wg4LwA3muX5h0EelqowpgeVf6HX1c5P4jRA39MA5ozPaYr3+rf7wvPFAx3EC6D2c= ARC-Authentication-Results: i=3; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9B58F386D2FB ARC-Seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=xKmyti4+kDjw8IbTnOxvEvf7tZpHsM3y2juJQsnDUwShBAxaXj8w4r8PeeEKwaXgRoYV9hQMVdVMoyxwZvOYkxqu83NFLTWASNJnxj/JyE7ixEzYPjdEj7N1O2vSRY4zQSJRlCRPpCncZd237P8dQ0tB/gpknnxZStv5VnmIs6WYsn/X/BR57vWnE3TygoJgU5HiO8XQ4BwOriSMMBirglQEJtJ1hxuwF3T7XSAg1oGXDH16GpKhuS7ARIQ0goRzHr4KXhcxLGkzLtX6EnJ8y05Bc94L9GXmurPWzP1bg0GceI6HMEis0YLLfaq4Fy4U8FjH1QhHb9VcBQrmpQZeig== 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=SNJthsvF3FJJGYKsD73TnNNsX+rbqkymtj+jrbCXkeI=; b=E4dqJ2Ip4R6iLlIDfnPPHnXG5qtRd5J78nRw/niw4F+ozTWGLT2uz9ctInUIHn3wyqRkMBwacoASHAYMDuwVk+32pZONkrmASM1zJpkqMDqp5/oj9/NcEWu0CUuz+oLznqCfvq34lF4ZwX26depkRcUFSM9WEhJ5zOudtZ3dE3HjHQmcCmUI77A1X2GoMhzzMndkMEo1Nc/0ccBOVAjcIsaglxu9+vAI0hDadriCBsxlBd/WPtz8kj3alp6gCcSUHQr2BwztB427/qL96+6LVtsUxb1VRrLwltFh7vURZNresVwa8lEusP6agVDjnB87TtaXAzf3mOcW5PR1ecUvCA== 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=SNJthsvF3FJJGYKsD73TnNNsX+rbqkymtj+jrbCXkeI=; b=OhkWqVFRNZ5jD0JfhC/DrKl+rCj9Ph/25noRp1Xj5mt1Ph97JJK+X9tY9nS378Vyrq54q0lsxHY9djbVEyk1c+zglhBWq15pJiyW7d8kMoiX/qswVFDjhDJR5t7rlPTRXmiMac0vwzWis7dbAwQCuvzqZH6181YVHQ27AHQbEEE= Received: from AS8PR04CA0175.eurprd04.prod.outlook.com (2603:10a6:20b:331::30) by PA6PR08MB10648.eurprd08.prod.outlook.com (2603:10a6:102:3cc::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8835.35; Thu, 19 Jun 2025 09:25:04 +0000 Received: from AM4PEPF00027A69.eurprd04.prod.outlook.com (2603:10a6:20b:331:cafe::24) by AS8PR04CA0175.outlook.office365.com (2603:10a6:20b:331::30) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8835.34 via Frontend Transport; Thu, 19 Jun 2025 09:25:03 +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 AM4PEPF00027A69.mail.protection.outlook.com (10.167.16.87) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8835.15 via Frontend Transport; Thu, 19 Jun 2025 09:25:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zF5D0aSNMFIuhqM1q9BXIGTsNiilIr1P++9kOwx5Q+bDXsjnVY28j4+3rqQcse0cagv+8BUlqPuY+7Z1rw2FUgQ/De/6rjxe0gv411bT51GuhwVxd90AIumRh1/nG5uJ2bIGcV9ZV28BfJo1p14fSqeWKjZAvcXfm6tnV9hwT/gXtcZ19LN4I/gQugp1zFxjSCTT1kn4+4gc12rBHAF12sf4CfJFXg7yLTyxsYH0j3zO09EQXehBSYklIfoI5nM0c/oLi6OLPJH22TeUJpMPySenKblkpRQYghn+r5GbgAMOisqZxbk8Nv+aGTiKmBnU5mgAiBSaiCEqeufNq/K9UA== 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=SNJthsvF3FJJGYKsD73TnNNsX+rbqkymtj+jrbCXkeI=; b=sjDE2jq2LQI2oOaAGKeqHL7VN3jiSKj9DWJ2mzlmSPPjeVb3aSl5gcEM4WVG/UBtDhm9e+vnLa8TlAFfim8qeb7ZR7cs13f+ZlkMZSvZb9bQmkrf6kLrOQNd2v64og0KEYIK/s71GGBb4KxUUhiXl1PaBaAz7bSYl6v7kKBXGfTLDAT06YG48oGY5blGPboNRebfRDvV2TAkRGL4mPWMpNPhqSZRVGet5ZI2jm3IUefLQc/7ZduOn7llh2ZSMx8k6jKuy1GF2kBUOjx2Uh6lTNoOSLyy/bgMH3T8OVp7MRgY5VS18tugE054Ai0cyzOiOUmla7wi/8m65MixSm2p4g== 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=SNJthsvF3FJJGYKsD73TnNNsX+rbqkymtj+jrbCXkeI=; b=OhkWqVFRNZ5jD0JfhC/DrKl+rCj9Ph/25noRp1Xj5mt1Ph97JJK+X9tY9nS378Vyrq54q0lsxHY9djbVEyk1c+zglhBWq15pJiyW7d8kMoiX/qswVFDjhDJR5t7rlPTRXmiMac0vwzWis7dbAwQCuvzqZH6181YVHQ27AHQbEEE= 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 AS4PR08MB7829.eurprd08.prod.outlook.com (2603:10a6:20b:519::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8835.26; Thu, 19 Jun 2025 09:24:30 +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:24:29 +0000 Message-ID: Date: Thu, 19 Jun 2025 10:24:22 +0100 User-Agent: Mozilla Thunderbird From: Luis Machado Subject: Re: [PATCH v4 05/11] gdb, gdbserver: Add support of Intel shadow stack pointer register. 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-6-christina.schimpe@intel.com> Content-Language: en-US In-Reply-To: <20250617121147.1956686-6-christina.schimpe@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: JNXP275CA0047.ZAFP275.PROD.OUTLOOK.COM (2603:1086:0:18::35) To PR3PR08MB5852.eurprd08.prod.outlook.com (2603:10a6:102:8e::21) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: PR3PR08MB5852:EE_|AS4PR08MB7829:EE_|AM4PEPF00027A69:EE_|PA6PR08MB10648:EE_ X-MS-Office365-Filtering-Correlation-Id: 38d9ef5e-33d6-4007-c941-08ddaf132bdd x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0;ARA:13230040|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info-Original: =?utf-8?B?aXFDSXh1bjh3Z2dDY3Z4MHVQeW0xNERjTnhhaXRtendRREh0U0JDWU1mZU9q?= =?utf-8?B?U1F0QUdYN0toSDF3ckcvc2xlSEhwa3N2V3RDaEx2aXJZWmhNbUxvQi9lSGtm?= =?utf-8?B?NEEzWWxtVlRtWGx6bDdjNG1RUWRDY29VQWlORGJTb2pyMm1jcytXOTFVWUZN?= =?utf-8?B?WVJHN2h5cE93eGpZRnNxRzJQaWRtbjF2UFNIVlVlSVVsaWdwMm9vUThWN0xp?= =?utf-8?B?UmhqZmFvS1lHdE9WczgxQUdtNThhUXFxOVNOSjBOQ2JPdUt6TWFwUVlPTE1D?= =?utf-8?B?NXlxOTFkbVMwOE5rYUl6R3dDeDhlMmYrOFYwanhqVmV1Z0dtblBXRUE4L0p0?= =?utf-8?B?K0dXbjFFTlhmaStmUmFQWDFzcTJUUVBVSG9HUnduL2pvR2NZQnVmMktHc1d0?= =?utf-8?B?dHVBT1gvTktaSmlKSHE3WlNDSWo0VkJOL1dNZFoyeGRKYWtxaVFYTDQ0QTNV?= =?utf-8?B?eWd5NFVYdWNiUC9YaXdsakRlK1VJdXNBWG9vZGZtekpxTVp5aEkwMFlDM3Np?= =?utf-8?B?RFF3SGEyelNBaXYvUFNOQjM3YmhxcEFvRjg1b1g0UHh6UTNadkYvb3BsVkhZ?= =?utf-8?B?QlBTakJHMnRaZjM2bW9tN0lmTklQUDg3bmJoaXAyeXFEZWw3RndrcTJMdXVy?= =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GV09KRFlvdDNPZ1NsdzJL?= =?utf-8?B?STJRQmFDR1BmTHRGbWRaUHdLSmhIK2tvajBhcVZhZTZMVWxHekdaQ25IZU1Q?= =?utf-8?B?SCt3UnFmeTJGV2ROTTF4d25ML1oyWGM5RkpRQ0NPU3VCYkRqU2ZWMHhPR2l1?= =?utf-8?B?MUM5cmFrRThDVnY4V3JBOCswQlI3SDAxYmNQU2FZeE1aVjRPbmFadEhzcVF0?= =?utf-8?B?RmF6VFVmeGNncmJNWnVjamp2bTVMNmNVWnlrRDdvdUVXemtzdUVPMm0vR094?= =?utf-8?Q?9xUT7napeanE2jieLUJeboy5Pv65ups4/+RgY=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)(366016)(1800799024)(376014); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR08MB7829 X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM4PEPF00027A69.eurprd04.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 7875c959-5bd2-41bf-3e00-08ddaf1317cc X-Microsoft-Antispam: BCL:0; ARA:13230040|376014|35042699022|82310400026|1800799024|36860700013|14060799003; X-Microsoft-Antispam-Message-Info: =?utf-8?B?WEw4VVU0NnlHZ2lZalI4dGZxVjY2RU5ES1VEVGc1S2RkODhyUERvT1poQnhu?= =?utf-8?B?NDlqZS9HNzZKWXRBNjQ0WTJaNkdkQTNTUWVibEFnUVVKS0JYcnZENW1yOCt3?= =?utf-8?B?UDNtYXNkTkFtb0kwSlZ6elhRZXVHMG14UXZwaU8ybWhDN2RyWnhHbzJvVlJr?= =?utf-8?B?aEtNb1YzOGtvdHJGZkVDTXNZejJXVzRVTElqZjhDbzVLdGtGUHFRYWQ2Qm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RPT0=?= 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)(376014)(35042699022)(82310400026)(1800799024)(36860700013)(14060799003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jun 2025 09:25:03.0566 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 38d9ef5e-33d6-4007-c941-08ddaf132bdd 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: AM4PEPF00027A69.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA6PR08MB10648 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 adds the user mode register PL3_SSP which is part of the > Intel(R) Control-Flow Enforcement Technology (CET) feature for support > of shadow stack. > For now, only native and remote debugging support for shadow stack > userspace on amd64 linux are covered by this patch including 64 bit and > x32 support. 32 bit support is not covered due to missing Linux kernel > support. > > This patch requires fixing the test gdb.base/inline-frame-cycle-unwind > which is failing in case the shadow stack pointer is unavailable. > Such a state is possible if shadow stack is disabled for the current thread > but supported by HW. > > This test uses the Python unwinder inline-frame-cycle-unwind.py which fakes > the cyclic stack cycle by reading the pending frame's registers and adding > them to the unwinder: > > ~~~ > for reg in pending_frame.architecture().registers("general"): > val = pending_frame.read_register(reg) > unwinder.add_saved_register(reg, val) > return unwinder > ~~~ > > However, in case the python unwinder is used we add a register (pl3_ssp) that is > unavailable. This leads to a NOT_AVAILABLE_ERROR caught in > gdb/frame-unwind.c:frame_unwind_try_unwinder and it is continued with standard > unwinders. This destroys the faked cyclic behavior and the stack is > further unwinded after frame 5. > > In the working scenario an error should be triggered: > ~~~ > bt > 0 inline_func () at /tmp/gdb.base/inline-frame-cycle-unwind.c:49^M > 1 normal_func () at /tmp/gdb.base/inline-frame-cycle-unwind.c:32^M > 2 0x000055555555516e in inline_func () at /tmp/gdb.base/inline-frame-cycle-unwind.c:45^M > 3 normal_func () at /tmp/gdb.base/inline-frame-cycle-unwind.c:32^M > 4 0x000055555555516e in inline_func () at /tmp/gdb.base/inline-frame-cycle-unwind.c:45^M > 5 normal_func () at /tmp/gdb.base/inline-frame-cycle-unwind.c:32^M > Backtrace stopped: previous frame identical to this frame (corrupt stack?) > (gdb) PASS: gdb.base/inline-frame-cycle-unwind.exp: cycle at level 5: backtrace when the unwind is broken at frame 5 > ~~~ > > To fix the Python unwinder, we simply skip the unavailable registers. > > Reviewed-by: Thiago Jung Bauermann > Reviewed-By: Eli Zaretskii > --- > gdb/NEWS | 3 + > gdb/amd64-linux-nat.c | 17 +++++ > gdb/amd64-linux-tdep.c | 1 + > gdb/amd64-tdep.c | 6 +- > gdb/amd64-tdep.h | 1 + > gdb/arch/amd64.c | 10 +++ > gdb/arch/i386.c | 4 ++ > gdb/arch/x86-linux-tdesc-features.c | 1 + > gdb/doc/gdb.texinfo | 4 ++ > gdb/features/Makefile | 2 + > gdb/features/i386/32bit-ssp.c | 14 ++++ > gdb/features/i386/32bit-ssp.xml | 11 +++ > gdb/features/i386/64bit-ssp.c | 14 ++++ > gdb/features/i386/64bit-ssp.xml | 11 +++ > gdb/i386-tdep.c | 22 +++++- > gdb/i386-tdep.h | 4 ++ > gdb/nat/x86-linux-tdesc.c | 2 + > gdb/nat/x86-linux.c | 55 +++++++++++++++ > gdb/nat/x86-linux.h | 4 ++ > gdb/testsuite/gdb.arch/amd64-shadow-stack.c | 22 ++++++ > gdb/testsuite/gdb.arch/amd64-ssp.exp | 50 +++++++++++++ > .../gdb.base/inline-frame-cycle-unwind.py | 4 ++ > gdb/testsuite/lib/gdb.exp | 70 +++++++++++++++++++ > gdb/x86-linux-nat.c | 50 +++++++++++-- > gdb/x86-linux-nat.h | 11 +++ > gdb/x86-tdep.c | 21 ++++++ > gdb/x86-tdep.h | 9 +++ > gdbserver/linux-x86-low.cc | 28 +++++++- > gdbsupport/x86-xstate.h | 5 +- > 29 files changed, 446 insertions(+), 10 deletions(-) > create mode 100644 gdb/features/i386/32bit-ssp.c > create mode 100644 gdb/features/i386/32bit-ssp.xml > create mode 100644 gdb/features/i386/64bit-ssp.c > create mode 100644 gdb/features/i386/64bit-ssp.xml > create mode 100644 gdb/testsuite/gdb.arch/amd64-shadow-stack.c > create mode 100644 gdb/testsuite/gdb.arch/amd64-ssp.exp > <...> > diff --git a/gdb/nat/x86-linux.c b/gdb/nat/x86-linux.c > index 0bdff736f8a..bf603182164 100644 > --- a/gdb/nat/x86-linux.c > +++ b/gdb/nat/x86-linux.c > @@ -17,6 +17,12 @@ > You should have received a copy of the GNU General Public License > along with this program. If not, see . */ > > +#include "elf/common.h" > +#include "gdbsupport/common-defs.h" > +#include "nat/gdb_ptrace.h" > +#include "nat/linux-ptrace.h" > +#include "nat/x86-cpuid.h" > +#include > #include "x86-linux.h" > #include "x86-linux-dregs.h" > #include "nat/gdb_ptrace.h" > @@ -126,3 +132,52 @@ x86_linux_ptrace_get_arch_size (int tid) > return x86_linux_arch_size (false, false); > #endif > } > + > +bool > +x86_check_ssp_support (const int tid) Missing the usual comment pointing at the header file? /* See nat/x86-linux.h. */ > +{ > + /* It's not enough to check shadow stack support with the ptrace call > + below only, as we cannot distinguish between shadow stack not enabled > + for the current thread and shadow stack is not supported by HW. In > + both scenarios the ptrace call fails with ENODEV. In case shadow > + stack is not enabled for the current thread, we still want to return > + true. */ > + unsigned int eax, ebx, ecx, edx; > + > + __get_cpuid_count (7, 0, &eax, &ebx, &ecx, &edx); > + > + if ((ecx & bit_SHSTK) == 0) > + return false; > + > + /* Further check for NT_X86_SHSTK kernel support. */ > + uint64_t ssp; > + iovec iov {&ssp, sizeof (ssp) }; > + > + errno = 0; > + int res = ptrace (PTRACE_GETREGSET, tid, NT_X86_SHSTK, &iov); > + if (res < 0) > + { > + if (errno == EINVAL) > + { > + /* The errno EINVAL for a PTRACE_GETREGSET call indicates that > + kernel support is not available. */ > + return false; > + } > + else if (errno == ENODEV) > + { > + /* At this point, since we already checked CPUID, the errno > + ENODEV for a PTRACE_GETREGSET call indicates that shadow > + stack is not enabled for the current thread. As it could be > + enabled later, we still want to return true here. */ > + return true; > + } > + else > + { > + warning (_("Unknown ptrace error for NT_X86_SHSTK: %s"), > + safe_strerror (errno)); > + return false; > + } > + } > + > + return true; > +} <...> > diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp > index 3f1cd55d727..7e56cf61a4c 100644 > --- a/gdb/testsuite/lib/gdb.exp > +++ b/gdb/testsuite/lib/gdb.exp > @@ -4287,6 +4287,76 @@ gdb_caching_proc allow_tsx_tests {} { > return $allow_tsx_tests > } > > +# Run a test on the target to check if it supports x86 shadow stack. Return 1 > +# if shadow stack is enabled, 0 otherwise. > + > +gdb_caching_proc allow_ssp_tests {} { > + global srcdir subdir gdb_prompt hex > + > + set me "allow_ssp_tests" > + > + if { ![istarget i?86-*-*] && ![istarget x86_64-*-* ] } { > + verbose "$me: target known to not support shadow stack." > + return 0 > + } > + > + # There is no need to check the actual HW in addition to ptrace support. > + # We need both checks and ptrace will tell us about the HW state. > + set compile_flags "{additional_flags=-fcf-protection=return}" > + set src { int main() { return 0; } } > + if {![gdb_simple_compile $me $src executable $compile_flags]} { > + return 0 > + } > + > + save_vars { ::env(GLIBC_TUNABLES) } { > + > + append_environment GLIBC_TUNABLES "glibc.cpu.hwcaps" "SHSTK" > + > + # No error message, compilation succeeded so now run it via gdb. > + gdb_exit > + gdb_start > + gdb_reinitialize_dir $srcdir/$subdir > + gdb_load $obj > + if {![runto_main]} { > + remote_file build delete $obj > + return 0 > + } > + set shadow_stack_disabled_re "()" > + if {[istarget *-*-linux*]} { > + # Starting with v6.6., the Linux kernel supports CET shadow stack. Small typo, period after v6.6. > + # Dependent on the target we can see a nullptr or "" > + # when shadow stack is supported by HW and the Linux kernel but > + # not enabled for the current thread (for example due to a lack > + # of compiler or glibc support for -fcf-protection). > + set shadow_stack_disabled_re "$shadow_stack_disabled_re|(.*0x0)" > + } > + > + set allow_ssp_tests 0 > + gdb_test_multiple "print \$pl3_ssp" "test shadow stack support" { > + -re -wrap "(.*$hex)((?!(.*0x0)).)" { > + verbose -log "$me: Shadow stack support detected." > + set allow_ssp_tests 1 > + } > + -re -wrap $shadow_stack_disabled_re { > + # In case shadow stack is not enabled (for example due to a > + # lack of compiler or glibc support for -fcf-protection). > + verbose -log "$me: Shadow stack is not enabled." > + } > + -re -wrap "void" { > + # In case we don't have hardware or kernel support. > + verbose -log "$me: No shadow stack support." > + } > + } > + > + gdb_exit > + } > + > + remote_file build delete $obj > + > + verbose "$me: returning $allow_ssp_tests" 2 > + return $allow_ssp_tests > +} > + > # Run a test on the target to see if it supports avx512bf16. Return 1 if so, > # 0 if it does not. Based on 'check_vmx_hw_available' from the GCC testsuite. > > diff --git a/gdb/x86-linux-nat.c b/gdb/x86-linux-nat.c > index a82ad21da27..865c017404e 100644 > --- a/gdb/x86-linux-nat.c > +++ b/gdb/x86-linux-nat.c > @@ -41,6 +41,7 @@ > #include "nat/x86-linux.h" > #include "nat/x86-linux-dregs.h" > #include "nat/linux-ptrace.h" > +#include "x86-tdep.h" > #include "nat/x86-linux-tdesc.h" > > /* linux_nat_target::low_new_fork implementation. */ > @@ -97,11 +98,10 @@ const struct target_desc * > x86_linux_nat_target::read_description () > { > /* The x86_linux_tdesc_for_tid call only reads xcr0 the first time it is > - called. The mask is stored in XSTATE_BV_STORAGE and reused on > - subsequent calls. Note that GDB currently supports features for user > - state components only. However, once supervisor state components are > - supported in GDB XSTATE_BV_STORAGE will not be configured based on > - xcr0 only. */ > + called. Also it checks the enablement state of features which are > + not configured in xcr0, such as CET shadow stack. Once the supported > + features are identified, the XSTATE_BV_STORAGE value is configured > + accordingly and preserved for subsequent calls of this function. */ > static uint64_t xstate_bv_storage; > > if (inferior_ptid == null_ptid) > @@ -215,6 +215,46 @@ x86_linux_get_thread_area (pid_t pid, void *addr, unsigned int *base_addr) > } > > > +/* See x86-linux-nat.h. */ > + > +void > +x86_linux_fetch_ssp (regcache *regcache, const int tid) > +{ > + uint64_t ssp = 0x0; > + iovec iov {&ssp, sizeof (ssp)}; > + > + /* The shadow stack may be enabled and disabled at runtime. Reading the > + ssp might fail as shadow stack was not activated for the current > + thread. We don't want to show a warning but silently return. The > + register will be shown as unavailable for the user. */ > + if (ptrace (PTRACE_GETREGSET, tid, NT_X86_SHSTK, &iov) != 0) > + return; > + > + x86_supply_ssp (regcache, ssp); > +} > + > +/* See x86-linux-nat.h. */ > + > +void > +x86_linux_store_ssp (const regcache *regcache, const int tid) > +{ > + uint64_t ssp = 0x0; > + iovec iov {&ssp, sizeof (ssp)}; > + x86_collect_ssp (regcache, ssp); > + > + /* Starting with v6.6., the Linux kernel supports CET shadow stack. Same typo, period after v6.6 > + Dependent on the target the ssp register can be unavailable or > + nullptr when shadow stack is supported by HW and the Linux kernel but > + not enabled for the current thread. In case of nullptr, GDB tries to > + restore the shadow stack pointer after an inferior call. The ptrace > + call with PTRACE_SETREGSET will fail here with errno ENODEV. We > + don't want to throw an error in this case but silently continue. */ > + errno = 0; > + if ((ptrace (PTRACE_SETREGSET, tid, NT_X86_SHSTK, &iov) != 0) > + && (errno != ENODEV)) > + perror_with_name (_("Failed to write pl3_ssp register")); > +} > + > void _initialize_x86_linux_nat (); > void > _initialize_x86_linux_nat () <...> Other than the cosmetic points above, the patch looks OK to me. I'm not entirely familiar with the feature for x86, but the enablement makes sense to me. Reviewed-By: Luis Machado