From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id ePdXM4deUWjY9BEAWB0awg (envelope-from ) for ; Tue, 17 Jun 2025 08:24:39 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=ektS1CpP; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id CEC491E11E; Tue, 17 Jun 2025 08:24:39 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-10.1 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,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 6B5191E089 for ; Tue, 17 Jun 2025 08:24:39 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2B97D3AA88A4 for ; Tue, 17 Jun 2025 12:24:39 +0000 (GMT) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 580AB3A6D5EA for ; Tue, 17 Jun 2025 12:22:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 580AB3A6D5EA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 580AB3A6D5EA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750162977; cv=none; b=A7b31gvWDdC9eiRCyv7M+VbDA7eqQ629QK3EpkppgKmmp2slv8V8H7e6R77+Kj7PYHUN3sTMeU6S1bj1dmW4Jf9gF/AD+cTyBP+1cgqpyyCDgp/lSwiPBEErBNwA857BhgWSfNgxcTtJ/RnGJg4M0Sph9ytE15LJiXEtRvaI4qA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1750162977; c=relaxed/simple; bh=4ifqkJq+C7FBKmiFFe7bk6OQS/RHr414AVEwV9+exCg=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=bMd/NL4PnEuShlIhxKJUx6kv4mcmbsZCLpScxKEcp2XSIQNvJ5kI6D5r+xn5l0MupRyfZyc/2Gg0mwfapU1DAax3CDh8zcIJ1gtOifnjaxI4Jml/pE94/ByNy9I54z+WM5PW2Dk0h+PClWu/p0B5RnmYfTBxZIuOkrl35Dcmzu0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uRVL4-000140-4n; Tue, 17 Jun 2025 08:22:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=8ApYRjUqR4X9/bX41VAUVdhzKev8nIcblrsSvK5eWbg=; b=ektS1CpPUvkY vYl9pXGxlTSlQrZE/G9S6kwdZKViScTudyp9fLbWpPG20w+W7Hrd90xSxGyAkWZXO65FhtjOW/0Tz jqTxy9IaldIRT9mtgXPhDtns5BTzPRYhgE9Q9iObC1WcT51b1bN1zLaNvh+j1RgccYEMkHlbl/uaN QJ3CEY2m+/LjpGzERB/fdIgkZBMUOdrByTS7m3I4wbJFvbIpBt98sxeY/WsnpFGv9mMfaKaQF2g9W VfXxHsVzLXTRwY0Mt0iDESIoyX3CqoAlfW8SFXNtYAdPWA8IVg4Hetylcrg5MYRnLJr6CTJyVH8Pi Cy/BZHI/FOsSAU8xHxSg0g==; Date: Tue, 17 Jun 2025 15:22:20 +0300 Message-Id: <861prio8w3.fsf@gnu.org> From: Eli Zaretskii To: Christina Schimpe Cc: gdb-patches@sourceware.org, thiago.bauermann@linaro.org In-Reply-To: <20250617121147.1956686-12-christina.schimpe@intel.com> (message from Christina Schimpe on Tue, 17 Jun 2025 12:11:47 +0000) Subject: Re: [PATCH v4 11/11] gdb: Enable displaced stepping with shadow stack on amd64 linux. References: <20250617121147.1956686-1-christina.schimpe@intel.com> <20250617121147.1956686-12-christina.schimpe@intel.com> 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 > From: Christina Schimpe > Cc: thiago.bauermann@linaro.org, > eliz@gnu.org > Date: Tue, 17 Jun 2025 12:11:47 +0000 > > 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. > > To avoid a control-protection exception if shadow stack is active, > the shadow stack top address must be corrected as well. > > 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 The NEWS part is okay, thanks. Reviewed-By: Eli Zaretskii