From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id LuS3IxwPg2Vw3SUAWB0awg (envelope-from ) for ; Wed, 20 Dec 2023 10:58:20 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=oBV0w7nl; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 82F481E0C3; Wed, 20 Dec 2023 10:58:20 -0500 (EST) 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 678E01E0AC for ; Wed, 20 Dec 2023 10:58:18 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9D6538618F8 for ; Wed, 20 Dec 2023 15:58:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D9D6538618F8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1703087897; bh=2oEG/4iyUZRiYzRaZ08eIiPPDNyPn/nmXibECe0ryYw=; h=Date:Subject:To:References:Cc:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=oBV0w7nly/BxOZ+xUWcLRH+ikBoYeOzn3wqQdFiB5bTHRLeoUkqeVrqZH4yJl4pIh c1oosT+Lw39+GUqlcOULOOokhtFnkHbRr80zoRuiSy4+lNxjXrfIWD8biVVV6JuBhH Ltpw5DcqAexl3ROB6snl8pS1ulTIr/xZvOQlD4yE= Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2066.outbound.protection.outlook.com [40.107.247.66]) by sourceware.org (Postfix) with ESMTPS id B65FD3858C2C for ; Wed, 20 Dec 2023 15:57:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B65FD3858C2C ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B65FD3858C2C ARC-Seal: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1703087869; cv=pass; b=WvTPKY7swvAPLwwKBBinWY8Jx0MkL068jlJStSP1cXYxCQwc48FQMQ1TQToyPtqaMMW19UHIkwhsNIAN/2Gt1xUu76M8nK8AKh6mExapQsAc+UqhI8KrhI0gdwcichdtrC63Jzn/+KCT/RCKljPxuiKN36cKGfixlaSSd/xI6Qc= ARC-Message-Signature: i=3; a=rsa-sha256; d=sourceware.org; s=key; t=1703087869; c=relaxed/simple; bh=TyjDuxTK723PbpIgFlKgQeIlFwDUhNr/PrEMQFpFyBg=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:Subject:To:From: MIME-Version; b=duXrtZjqP1KHoyyfgoNs2enDewzWgOhqkC/Ww+1b6SJHLxQylRawxUfG/wyERwEEXNwYi3/giyFKr94bxYlS1VFBZ1SPFc+Vx+H0zs3kbcQWg5ro05K9qK4ebEHNg5kQ4iLWAEhWJe14I8A/0f+Vub6+6AeyLbbxdO1nz4mkZJk= ARC-Authentication-Results: i=3; server2.sourceware.org ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=FVVAn0/JVVT5dY7spmm/3uA8BETueDwNPB5ri716T5OS9CzmW7BwWYSoRS0RV3aKzy/K3VYJVwwbA4jd76P1MiaQnjBgBlN5cOSpq/K2cWojzS/pv+t6KysBOwUVLyhY70MriDQteK2Sh6N3TqNqpw01ZpzO5gT9hMpy+C1efYL1w0LiX91k/sVZzo+EWKgYhGhTu1MIBINh9EF40UTiaZmjM6Q3gpcUo2G7st8VkQD0oc0gIV5K0tPs3ySzUZL5OnXTR6EeK8At1JrQxxoyTRt3Xdywfspb3sNxK4R7Ika3EP/ACJOArhArITV5SP5L9xp3p7ZXZbD3PxXmprkyRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=2oEG/4iyUZRiYzRaZ08eIiPPDNyPn/nmXibECe0ryYw=; b=JHj+Y+9hC6Q96EJVIW27w3g5tkBcHH+xzQjd5dI7mm843uRAV16iYyWRS+3oS9WDth9oxx8eEJkYdJ6Bq01cBqGSDNa+7X/9VupFNmz7oCkHm1esKiNn3ZXm9nIe89VyzXGqy+oTj5KrHFYUZM4xb/+jXVpmQCuVayZu5nI5uzkegfltwYKfWoQWmcyYkdb2sWUA2GFbsrYIRUcjdzy2K2CdJQ50vDEINNh8D/wLTP1iB3aXWGLjmtwqa6UuR8SB/g+J+Y0JS18+UurlMuHusSY7+4vg4CRaArEE0OJLfx6Na0kqcYwdon6lv8pTbihPz2wT9GO28/7Of6vtHj/1tw== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=sourceware.org 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=armh.onmicrosoft.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]) Received: from DB8P191CA0015.EURP191.PROD.OUTLOOK.COM (2603:10a6:10:130::25) by GV2PR08MB9927.eurprd08.prod.outlook.com (2603:10a6:150:bf::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Wed, 20 Dec 2023 15:57:41 +0000 Received: from DU2PEPF0001E9C0.eurprd03.prod.outlook.com (2603:10a6:10:130:cafe::1c) by DB8P191CA0015.outlook.office365.com (2603:10a6:10:130::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18 via Frontend Transport; Wed, 20 Dec 2023 15:57:40 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DU2PEPF0001E9C0.mail.protection.outlook.com (10.167.8.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18 via Frontend Transport; Wed, 20 Dec 2023 15:57:40 +0000 Received: ("Tessian outbound e243565b0037:v228"); Wed, 20 Dec 2023 15:57:40 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: c991a795b3242f6a X-CR-MTA-TID: 64aa7808 Received: from c78e4bfecf07.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EA53A2E5-D206-46ED-9E13-541E9A432FCE.1; Wed, 20 Dec 2023 15:57:33 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id c78e4bfecf07.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 20 Dec 2023 15:57:33 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UXRBwySl9p/BXm6T9qdCkw2TZqMehR97SxwZh5NvYnXMI+3V8z9BnQdnF0lvaEAnbECyYRpMdoOOPyRJIRbOwfrrf3K0IxmdoLwxkyV8QbtQvTABnVJTH0i/IJkPC/9FY1v2CT7MoYY4eUfxdhfbK1N+RQ6aYjxU9NZtSJKgByVDA0Oc3H53sMRrqLmP54r3T1PCHpD4tNO6c0l5k+ICy0TqoLVd/Mcklzb50H7eYXNSVxkSKW7oWaULWuyCNw07v+TDTazwtf8QP/909hVYEPohKujZr3ySqt2X+ECc94TU6RgK0tg9CD9/7wE6n7Fx2gfhVK9iHjBgags+3FhkAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=2oEG/4iyUZRiYzRaZ08eIiPPDNyPn/nmXibECe0ryYw=; b=PdPPqVZVVYH5kdhU2zBkZWLURQ1ehtgJkibN925++epFt+IVBKTx0smheSfoWnAGOCQygphnulo+svZOsgaK6eb0lOeCAZsKjDk5Z+yDi9L7PTdbidwWTdr/2fpFTanoR7s0PnP6ZVUTGjW8fwy4sAKCN/K5FNEiO/pBWqCbsKqATQdgAd3UyFI6qt293WXOq2E/GXt5wBZf54xOppHIXYbyc7JybMmZJ639KmyrtD6RAwoQxR2kGcPA4nrOyRlkoywV+Ywy25bZAss5FzyLBDi30+CFS8Wu/Enze6jrdvebn1lolh7WV/EXL3Fs85vBwfhJLkdC3V34guNyNbXo7g== 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 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; Received: from VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) by PAVPR08MB9040.eurprd08.prod.outlook.com (2603:10a6:102:32d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7091.38; Wed, 20 Dec 2023 15:57:29 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::e05e:c012:f1f9:eb51]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::e05e:c012:f1f9:eb51%4]) with mapi id 15.20.7091.034; Wed, 20 Dec 2023 15:57:29 +0000 Message-ID: Date: Wed, 20 Dec 2023 15:57:24 +0000 User-Agent: Mozilla Thunderbird Subject: Re: Shadow stack backtrace command name Content-Language: en-US To: "Schimpe, Christina" , "gdb@sourceware.org" References: <0dc1193d-83dc-4433-9f2b-25f3d1bb42fd@arm.com> Cc: Thiago Jung Bauermann In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0296.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:196::13) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|PAVPR08MB9040:EE_|DU2PEPF0001E9C0:EE_|GV2PR08MB9927:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a558e2f-043d-4815-7016-08dc01746575 x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: ubFn2LlgcjZl9m0UOxtp6PHN0BC7385d0D3B/JMbv3+IUIOKsglTmgx2fbUbWVYZzIPS8SVyHxJC1P0eMqTUnbusEQkLsnrmooEnkkbVo1aBqvOJXjWBFXpAimagRKdtdEgDxMur+Cdgh3xKOuGcsiEnyDKTWmf7iIVDwszbi24TVfuNUVMxU1+WZDYH92b0c/QasuARsm4aYsC6jBBrgnm/Bj8k/xhc/K/ZG5p0oZqixL1IVjk3qwm4yhqOOBGQLOCZb84/rUM6T79nPDdYljhD+0Worfcu6lA/O7E4yz+8TQDJcNTdJeXhIrMbX2pxblxH0pMi9LWoo7jTRHaGDCyZtSqP3XephwSmeJiJMkMWH+dcMPRHaurUSBc2M9Tzt/nYOMcFy6oyD8OZMGHB4w8zZbrIu78K3U2f5YpYDFovj6W7WrS5yhX+5JUeNrUZPtJQsm2uBtajP+HCaJc3W3+AwWyfFa4TPEIyKPh0Tu6uBe8p2aqxC7U+ZIO5tkbj7MMPk6Yr8myeqm1nchlS8Z2BCE3z6VQ+dgnzmpaafeFD2n6PphWQy9hA+A+1nySouWc19PDSXUCTVMV0lRMBXmFBceCJmAAo/KH4k6NlcwJf+/z8HJpXZrhJQBCzMMBxUPwELtFdTDNZHFXy2468/g== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR08MB3919.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(366004)(396003)(39860400002)(136003)(376002)(346002)(230922051799003)(186009)(64100799003)(1800799012)(451199024)(8676002)(8936002)(4326008)(26005)(478600001)(2906002)(966005)(316002)(6486002)(6666004)(44832011)(31686004)(66946007)(66476007)(110136005)(66556008)(6506007)(66899024)(5660300002)(53546011)(6512007)(86362001)(31696002)(2616005)(83380400001)(38100700002)(36756003)(41300700001)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAVPR08MB9040 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DU2PEPF0001E9C0.eurprd03.prod.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 81ac3913-c232-4171-62f5-08dc01745e6c X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HJDo0iBiJsqGZfnaq/GkGez1jM2bPbZziAu9EESCkuJGBzYs9WWfD1VRir01ff7QQGEWer2CAprwPpYLpt8SztjopMYlpEdn6tQBWgaN2lR7rsuMQeTqR1hPvmnOjy0k4yB1iGWiYnaktNVHv3imwAeoNXI4etOk0ZexFq3csXAXlG9i7FiUCDo0NNqbBU19USKBHRpk1Qnot0CJDJXrEfM8qLPo7eDpQCXQiFIiBEz4PNFa1sbEC7898rr8zGGL8L8mFH0iKVqOgE1FpO3UGa6ZkEYwI3L4tzwqaJuccC1BE94uhwqSqdKb2jwW9HNNRYen2gQ3Yoa7GgdVQr7UJpFQJ1sPahe5l8HzacE6dklKqlxapoK5ff2l7wdGOGSWi/2Z3zr2AIHCWEEZTIZNj/y7ifbYgVfNiyfxp/9kXYe21kHaT/PSs4Bzrkb7kto4bgNx9Fu/Tc57LTe+cWTVRsPDriT+sF0WNrk3hTh73J7UowLOWGa2M8FIdYtp9BHI2aRdZCFjfZyEeoUGELBCQK+G2aAHnhoLhqsKPkNeA23yVfTvFdrwIYlfjbhJSJU1XtyzGNk1/FwI97xCoVHnNEjkOb9HEkJl5bz5+9e3rkqZ+ou7rg6QOzcCSzXL7CWgVUXcvJHur8JDczpLec1h/63mzu3BWAZpswGN3CyglKkGZFoiHjMU13XvrlfK0ylnHU5A4tVmYy1guGYD8u3jrHfp5JapOfuSg1d8azjm+dGe9223wrp04LKXp+PX8TnN X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(396003)(39860400002)(136003)(346002)(230922051799003)(82310400011)(451199024)(186009)(1800799012)(64100799003)(36840700001)(40470700004)(46966006)(66899024)(40480700001)(40460700003)(31686004)(336012)(107886003)(2616005)(6512007)(53546011)(6666004)(26005)(6506007)(83380400001)(82740400003)(81166007)(356005)(2906002)(36756003)(86362001)(31696002)(478600001)(4326008)(41300700001)(8936002)(110136005)(36860700001)(8676002)(5660300002)(47076005)(44832011)(966005)(6486002)(70586007)(316002)(70206006)(43740500002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 15:57:40.9797 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9a558e2f-043d-4815-7016-08dc01746575 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF0001E9C0.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9927 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb Reply-To: Luis Machado Errors-To: gdb-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb" Hi, On 12/20/23 15:35, Schimpe, Christina wrote: > Hi, > > Thanks a lot for your feedback. Please find my answers to your comments below. > >>> Having in mind that that the shadow stack is not only a x86-specific >>> feature but can be seen as a generic concept we also considered that >>> it could be part of the existing backtrace command, e.g.: >>> - "bt -shadow" >>> (+) Short syntax >>> (+/-) Most of the settings of the bt command don't apply to the shadow >>> stack (frame arguments and info). This might cause confusion. >>> >>> For this option, it might make sense to introduce a new setting for >>> the bt command which is for shadow stack only, e.g. "-symbol-filename >> [on|off]". >>> >>> What are your thoughts on this topic? Any feedback and new ideas are >> welcome. >> >> I like the option of reusing whatever is possible to reuse from the current >> backtrace command, so "bt -shadow" seems like a sensible option. >> >> It doesn't seem to me like this command will be used a lot. I expect it will be >> useful only when we catch a fault due to a corrupt stack trace, so putting it within >> the more general "backtrace" option would accomplish that. >> >> With that said, depending on how shadow stack support is implemented in gdb, I >> expect gdb will automatically validate the stack trace against the shadow stack >> (maybe on a fault), and complain if they go out of sync. Does that sound >> reasonable? Maybe even display where the flow veered off course. > > No, we don't plan to validate the stack trace in GDB, as we don't see much > additional value for the user. > In case of a CET violation the user will see a SEGV with CP specific > si_code = 10 (SEGV_CPERR). Printing siginfo will help to find out the reason for SEGV. > Inspecting the shadow stack and normal bt will show where the traces got out of sync. Thanks for clarifying it. My understanding is that aarch64 will also use SEGV_CPERR for the GCS faults, so it will be in sync with CET regarding reporting. > >> AArch64 will have a counterpart of this, with the Guarded Control Stack (GCS) >> feature, so the more generic we make this, the better. > > Would the option's name "-shadow" be suitable for the GCS? I find it difficult to come > up with a more generic name that would cover both. >From this entry [1], looks like the term shadow stack is a reasonably generic way to refer to this feature. So I think it is a suitable name, and would work for GCS as well. [1] https://en.wikipedia.org/wiki/Shadow_stack