From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2069.outbound.protection.outlook.com [40.107.247.69]) by sourceware.org (Postfix) with ESMTPS id 0EE2E3858D28 for ; Wed, 12 Apr 2023 08:47:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0EE2E3858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5rCP6T4p/AKDXI4xqq18996L/891EiSTMwB3I0Wunv0=; b=g7/9E0jlBYObw74BVKU2EJit1Jer9jNT96G873JqNyiNRLj3qdA2Jo45KW1bWpDnpNxOtk7ttoxHpnXQyXWUAmiOsiPJTv7lq/yMevy9Dy4lp7WbMt1DoI5NzVubpaUiXuQOG2HjrtrzqF3bz9tO20ORWp96WWVCS1km+d08vM4= Received: from AM6P192CA0039.EURP192.PROD.OUTLOOK.COM (2603:10a6:209:82::16) by AS2PR08MB8407.eurprd08.prod.outlook.com (2603:10a6:20b:55a::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Wed, 12 Apr 2023 08:46:50 +0000 Received: from AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:82:cafe::ff) by AM6P192CA0039.outlook.office365.com (2603:10a6:209:82::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.30 via Frontend Transport; Wed, 12 Apr 2023 08:46:50 +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 AM7EUR03FT041.mail.protection.outlook.com (100.127.140.233) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.29 via Frontend Transport; Wed, 12 Apr 2023 08:46:50 +0000 Received: ("Tessian outbound 99a3040377ca:v136"); Wed, 12 Apr 2023 08:46:50 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 17f7774dedbe9224 X-CR-MTA-TID: 64aa7808 Received: from 82420b45034c.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 4CEDCCA3-7C00-4F53-A77A-819515E523E4.1; Wed, 12 Apr 2023 08:46:44 +0000 Received: from EUR05-DB8-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 82420b45034c.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Wed, 12 Apr 2023 08:46:44 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i9uVnulnnFgy6Pj/jm6KU/YQL2zWA4NoxM//AZFB/tX9Ayl4pLz4oxxkxBoBBc7EFcW0t+NdC++Ccm2fNW8Yx5reUlYrxDScajvtdc8aj9ZxiHxL00yZy98hrrPhYOnImApqYrTqR3T7adl34hoBQrturLqtLVrQ15LpP+Bkw/3hd7P6noG2H0wSjYFrhtwUMAts6TQRfRYLH0MgXalQ1W7uRT2grv9d87czH7vhS/9r+O440OWSNuPk26BY0fPzWWUXC7LiHLhUmxYvINFFINQniGdmc067bswvSSoyeetbkNU3bpNZ8O+4OpYQeOzbVkXhHwdX3PGVim3dsTU0yA== 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=5rCP6T4p/AKDXI4xqq18996L/891EiSTMwB3I0Wunv0=; b=jPGbNTXZhPl5M2P9Nn4h11bsmpkNopl6k2CXgnB5Z8LJrQbq8cZz6xEP4uRv9RQIVSGU2Aw1zU1nRaTbmqJHpTHAcnqfkXVU60jCkfZXE6Rv4tydUjJxUe/X+xWdDFFkPiAOmZFUDUnmbpbhjaGWuWKKfxg0OoQeqyzbFOtDx0e+cNEqd+zDDCMhFzGer4sIC51k1icoEPROlgXXLswf3eoSlK7loAWW4sUarEw4vfg2XtDtbKOOGlJZkMq/S2czdlWl88l6VQgDEVZgXr2pNQDID2Iqjnp6zm0lJJvZZfnQUtea9tk5PAxdBXIqEeaSS7awSlErJNGBO9QEXhpD6g== 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=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=5rCP6T4p/AKDXI4xqq18996L/891EiSTMwB3I0Wunv0=; b=g7/9E0jlBYObw74BVKU2EJit1Jer9jNT96G873JqNyiNRLj3qdA2Jo45KW1bWpDnpNxOtk7ttoxHpnXQyXWUAmiOsiPJTv7lq/yMevy9Dy4lp7WbMt1DoI5NzVubpaUiXuQOG2HjrtrzqF3bz9tO20ORWp96WWVCS1km+d08vM4= 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 GV1PR08MB8619.eurprd08.prod.outlook.com (2603:10a6:150:83::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Wed, 12 Apr 2023 08:46:40 +0000 Received: from VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::ff70:5431:70fa:34bf]) by VI1PR08MB3919.eurprd08.prod.outlook.com ([fe80::ff70:5431:70fa:34bf%4]) with mapi id 15.20.6277.038; Wed, 12 Apr 2023 08:46:39 +0000 Message-ID: <63c2cf2c-692c-7737-d0ee-b8cb30439b4c@arm.com> Date: Wed, 12 Apr 2023 09:46:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] [gdb/aarch64] pauth: Create new feature string for pauth to prevent crashing older gdb's Content-Language: en-US To: Eli Zaretskii Cc: gdb-patches@sourceware.org, alex.bennee@linaro.org, richard.henderson@linaro.org, peter.maydell@linaro.org References: <20230411224327.2142994-1-luis.machado@arm.com> <83mt3d8wkf.fsf@gnu.org> From: Luis Machado In-Reply-To: <83mt3d8wkf.fsf@gnu.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SA9PR13CA0174.namprd13.prod.outlook.com (2603:10b6:806:28::29) To VI1PR08MB3919.eurprd08.prod.outlook.com (2603:10a6:803:c4::31) MIME-Version: 1.0 X-MS-TrafficTypeDiagnostic: VI1PR08MB3919:EE_|GV1PR08MB8619:EE_|AM7EUR03FT041:EE_|AS2PR08MB8407:EE_ X-MS-Office365-Filtering-Correlation-Id: 4cf30873-f4bf-445a-c505-08db3b32754d 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: e1IH7IQGjijU/Tg6yoUSlzWGZB1VJdYgJ9JbuHrqo2GKe4UDtN+5tFuwnMxplFzXH2nKY6OXXQnDB3Nmm0FpeNfoTJOv1N6z1VxUNG/jpcuCRpt/lJ18aQQCYOl1CFD+oOAF3eVhACoFceR7TjST7XICeUW6JTpQbQ9N3q8SMgfH7HCxNeGxkvWxS/Jrmr9cwHw5IHH7jyaXW8WPFZiTSgumN9YPiznXPQptraaVeL0Ujl3+cy0LhNgT2o+/7iAWliIoMpAhDt43EdkZBJeE1ek7wuq01ahsBXNj4E9mXlU19VdST857HkApvv4Jrjs12VHU+qJovn2eeV2mqUGsihdPQQIlgc7fezbfOyBKSLB+6bR0RkzguUQW+t/UDGrZ0OY2osh/FcbxVUiXe8dgAigM+GrP27hxQW1hqOTX5irmc36B8SnkRIdie7/0gzXFUtKY3QXEuWGTYC61iPlyE8FCU4o8WVw/pyYKQowBOMhmkZYEb4jXWt7lmiARGCJ7UwNCliEvxmniG1DtC5pEOV038M4DTW0xKaYf/oMso2pSkTJdBR+CEmJZ9YAONjifa7UYjK5X+1y12gtaxAvIh7y6JYPA9JWY1/KHRpgrOBpAaJPxPqzYl+SWLdugr7zed9K+HTw3ep9UL8keYH9C1A== 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:(13230028)(4636009)(346002)(39860400002)(376002)(396003)(136003)(366004)(451199021)(478600001)(6666004)(26005)(316002)(186003)(5660300002)(6506007)(6486002)(6512007)(53546011)(2906002)(44832011)(66556008)(66946007)(41300700001)(8676002)(66476007)(8936002)(6916009)(4326008)(38100700002)(31696002)(86362001)(36756003)(83380400001)(2616005)(31686004)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR08MB8619 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: AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 92742a61-ecad-4ad5-4604-08db3b326e44 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6QvCTMrAA5AFw+91n9BLFbPxY24mnqb52IwDr+asBY0lBzG013Qw629ExUnb5nl1/NrReGDvQfhPnoPqgMDS6Odz4YEpOwkIHmtk/k6+oQTaXGD3AJ1e8yGlYjqVyD9IJK3PTMfxlLkyIc1BUQhL/Ww1By4+VHNQwqpXVZ5oCE50a+sQgk8XAfqI3ulxEHnyYMdUMFlweBQNe7S4l0AzwH4ZpOdx3YIFE8MVMWrO/3nPgTpncXRHQq4APpSlKBBX5ZqfIqvVEcZBW/gvSrGHHNjXAaziIDJ/ZTrOGzXjsctFQcZZvyiZeKGfQUhKFpV807aQqUebXtxYrLRj+hUHIQVFMla7VGwf0T9/cj/ImElSQ0tx98jUZm2vGDZsdpCB2HrJk9Z7FCfg8s+9JyVs9/6pYT82aeHMq9hqapEuBCzw7gXMyiRnHF4vr8qwt1Z7qGfjkske3jAJKjgPw0Yo79xlJi2s2mMLdEofklwcVcu4/T3wkqUqC7zygh9Up11M7d4wpVjVYcS4fZzQgXAcgoOOUPhXGY17sWFYdojPYM3ozww7k31Wc/RSLsKxSx+P6bsGW2zhWWy6CgqUjvos0kNyzaMvhy6kx1DCL1J3TB8iBnxZeg2MSKMStBX80etndeFpMjy//2uubO4iQWvfcg7AG+bU6VSKowLbhX7ntZdAO/pmld3IwtP3u9b92HSR+sQ3Eg0BTztQ2ERvPJA9Aar02vpjPBIdtkz+oLDKO/4= 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:(13230028)(4636009)(376002)(346002)(39860400002)(136003)(396003)(451199021)(36840700001)(46966006)(40470700004)(86362001)(31696002)(36756003)(2906002)(82310400005)(31686004)(6486002)(40480700001)(6666004)(107886003)(186003)(36860700001)(336012)(47076005)(83380400001)(53546011)(2616005)(26005)(6506007)(6512007)(478600001)(4326008)(70586007)(40460700003)(70206006)(8676002)(356005)(81166007)(82740400003)(8936002)(6862004)(41300700001)(316002)(44832011)(5660300002)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2023 08:46:50.4866 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4cf30873-f4bf-445a-c505-08db3b32754d 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: AM7EUR03FT041.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR08MB8407 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,FORGED_SPF_HELO,GIT_PATCH_0,KAM_DMARC_NONE,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE,TXREP,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi Eli, On 4/12/23 07:04, Eli Zaretskii wrote: >> CC: , , >> >> Date: Tue, 11 Apr 2023 23:43:27 +0100 >> From: Luis Machado via Gdb-patches >> >> I've added some documentation to explain the situation. >> --- >> gdb/aarch64-tdep.c | 15 ++++++++++++++- >> gdb/doc/gdb.texinfo | 16 ++++++++++++++++ >> 2 files changed, 30 insertions(+), 1 deletion(-) > > Thanks. > >> diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo >> index 45a0580bc29..aefeb63f75c 100644 >> --- a/gdb/doc/gdb.texinfo >> +++ b/gdb/doc/gdb.texinfo >> @@ -47980,6 +47980,22 @@ has a signed link register value that needs to be unmasked/decoded. >> Extra registers are allowed in this feature, but they will not affect >> @value{GDBN}. >> >> +Due to a bug in previous versions of @value{GDBN} (versions 9, 10, 11 and 12), >> +a new feature string was created to prevent targets causing a @value{GDBN} >> +crash whenever they reported support for Pointer Authentication and also >> +reported additional system registers that were not accounted for by >> +@value{GDBN}. This is common when using emulators and on bare-metal debugging >> +scenarios. >> + >> +The new feature string is @samp{org.gnu.gdb.aarch64.pauth_v2}, and it has >> +the same contents as feature string @samp{org.gnu.gdb.aarch64.pauth}. >> + >> +Targets reporting Pointer Authentication support via the remote protocol >> +should always use the newer feature string @samp{org.gnu.gdb.aarch64.pauth_v2}. >> + >> +In the future the @samp{org.gnu.gdb.aarch64.pauth} feature string might be >> +deprecated in favor of @samp{org.gnu.gdb.aarch64.pauth_v2}. >> + > > Since this is the manual for GDB users, it should describe the feature > first, and explain its use and rationale after that. So this > description is backwards: it starts with the reason for introduction > of this feature, something that doesn't necessarily make sense to the > reader of the manual. > > Instead, we should first say that 'org.gnu.gdb.aarch64.pauth' will be > deprecated in favor of 'org.gnu.gdb.aarch64.pauth_v2', then introduce > 'org.gnu.gdb.aarch64.pauth_v2' saying that it has the same contents as > the former, and finally explain that targets should use > 'org.gnu.gdb.aarch64.pauth_v2' to avoid the danger of crashing older > GDBs. > > OK? It sounds OK. How about the following flow? In the future the @samp{org.gnu.gdb.aarch64.pauth} feature string might be deprecated in favor of feature string @samp{org.gnu.gdb.aarch64.pauth_v2}. The @samp{org.gnu.gdb.aarch64.pauth_v2} feature has the exact same contents as feature @samp{org.gnu.gdb.aarch64.pauth}. Targets reporting Pointer Authentication support via the remote protocol should always use the newer feature string @samp{org.gnu.gdb.aarch64.pauth_v2}. The reason for having feature @samp{org.gnu.gdb.aarch64.pauth_v2} is a bug in previous versions of @value{GDBN} (versions 9, 10, 11 and 12). This bug caused @value{GDBN} to crash whenever the target reported support for Pointer Authentication (using feature string @samp{org.gnu.gdb.aarch64.pauth}) and also reported additional system registers that were not accounted for by @value{GDBN}. This is common when using emulators and on bare-metal debugging scenarios. > > Reviewed-By: Eli Zaretskii