From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4CEFC397202D; Thu, 14 May 2020 15:17:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4CEFC397202D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1589469472; bh=CZPMmr88XEm5FttWyE5Ph4Y2QZtkPl725M9qLtEEjj0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=TvY6ayAl+tMjSUF70A3bxCNc4/oZr36l9QYzdf0D0ESEN4jTLEBKmgNDIhO9rPpct /0Vmvm65dG+X/FSVeWUoaa9Md9D5Pr7Joos1/KIihLtS6P8Fq9Jm9ARe/SZlF4JDki KF+y+/H7qb6AWlV4So9Bgcp95cywm/wzBvKmh1yQ= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/94515] aarch64: broken unwind information for pac-ret Date: Thu, 14 May 2020 15:17:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: EH, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: nsz at gcc dot gnu.org 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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 May 2020 15:17:52 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94515 --- Comment #3 from CVS Commits --- The releases/gcc-9 branch has been updated by Szabolcs Nagy : https://gcc.gnu.org/g:95833c34424f340a7e465ee38b6a41369bc7c90b commit r9-8593-g95833c34424f340a7e465ee38b6a41369bc7c90b Author: Szabolcs Nagy Date: Mon Apr 27 09:07:15 2020 +0100 aarch64: Fix .cfi_window_save with pac-ret [PR94515] On aarch64 -mbranch-protection=3Dpac-ret reuses the dwarf opcode for window_save to mean "toggle the return address mangle state", but in the dwarf2cfi internal logic the state was not updated when an opcode was emitted, the currently present update logic is only valid for the original sparc use of window_save so a separate bool is used on aarch64 to track the state. This bug can cause the unwinder not to authenticate return addresses that were signed (or vice versa) which means a runtime crash on a pauth enabled system. Currently only aarch64 pac-ret uses REG_CFA_TOGGLE_RA_MANGLE. This should be backported to gcc-9 and gcc-8 branches. gcc/ChangeLog: Backport from mainline. 2020-04-27 Szabolcs Nagy PR target/94515 * dwarf2cfi.c (struct GTY): Add ra_mangled. (cfi_row_equal_p): Check ra_mangled. (dwarf2out_frame_debug_cfa_window_save): Remove the argument, this only handles the sparc logic now. (dwarf2out_frame_debug_cfa_toggle_ra_mangle): New function for the aarch64 specific logic. (dwarf2out_frame_debug): Update to use the new subroutines. (change_cfi_row): Check ra_mangled. gcc/testsuite/ChangeLog: Backport from mainline. 2020-04-27 Szabolcs Nagy PR target/94515 * g++.target/aarch64/pr94515-1.C: New test. * g++.target/aarch64/pr94515-2.C: New test.=