From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1AD84382FAD4; Fri, 16 Dec 2022 11:19:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1AD84382FAD4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671189599; bh=KRKWQvvnlQ2TyR/I2P7l64DYp3+lWABBE1dGUx598mE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=qtQvAMtkoP1//Vzfn59iwDsZ/9dcQx1alicsRCOC4P7Nwk1Aq5xzNAxIOixFMlxs7 jLFwbAA3iu63U65lVvyJr7/DKZK7FvlLRvXstVEScmUgks6BbUE2KtTuetObmNKI/i RTuz7t4s+IuZ4uKJj+HcP3O7fccdm/wkGkdNF/78= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug gdb/28947] GDB does not remove AArch64 pointer signatures before doing memory accesses Date: Fri, 16 Dec 2022 11:19:56 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: luis.machado at arm dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28947 --- Comment #7 from cvs-commit at gcc dot gnu.org --- The master branch has been updated by Luis Machado : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dd88cb738e6a7= a7179dfaff8af78d69250c852af1 commit d88cb738e6a7a7179dfaff8af78d69250c852af1 Author: Luis Machado Date: Tue May 24 23:31:09 2022 +0100 [aarch64] Fix removal of non-address bits for PAuth PR gdb/28947 The address_significant gdbarch setting was introduced as a way to remo= ve non-address bits from pointers, and it is specified by a constant. This constant represents the number of address bits in a pointer. Right now AArch64 is the only architecture that uses it, and 56 was a correct option so far. But if we are using Pointer Authentication (PAuth), we might use up to 2 bytes from the address space to store the required information. We could also have cases where we're using both PAuth and MTE. We could adjust the constant to 48 to cover those cases, but this doesn= 't cover the case where GDB needs to sign-extend kernel addresses after removal of the non-address bits. This has worked so far because bit 55 is used to select between kernel-space and user-space addresses. But trying to clear a range of bits crossing= the bit 55 boundary requires the hook to be smarter. The following patch renames the gdbarch hook from significant_addr_bit = to remove_non_address_bits and passes a pointer as opposed to the number of bits. The hook is now responsible for removing the required non-address bits and sign-extending the address if needed. While at it, make GDB and GDBServer share some more code for aarch64 and add a new arch-specific testcase gdb.arch/aarch64-non-address-bits.exp. Bug-url: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28947 Approved-By: Simon Marchi --=20 You are receiving this mail because: You are on the CC list for the bug.=