public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/94515] aarch64: broken unwind information for pac-ret
Date: Mon, 27 Apr 2020 08:11:27 +0000	[thread overview]
Message-ID: <bug-94515-4-H7J2rpKpA9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-94515-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94515

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Szabolcs Nagy <nsz@gcc.gnu.org>:

https://gcc.gnu.org/g:acdf733634745548c0167c40bad80e6140ac2eeb

commit r10-7986-gacdf733634745548c0167c40bad80e6140ac2eeb
Author: Szabolcs Nagy <szabolcs.nagy@arm.com>
Date:   Mon Apr 27 09:07:15 2020 +0100

    aarch64: Fix .cfi_window_save with pac-ret [PR94515]

    On aarch64 -mbranch-protection=pac-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:

            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:

            PR target/94515
            * g++.target/aarch64/pr94515-1.C: New test.
            * g++.target/aarch64/pr94515-2.C: New test.

  parent reply	other threads:[~2020-04-27  8:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-07 11:48 [Bug target/94515] New: " nsz at gcc dot gnu.org
2020-04-21 14:26 ` [Bug target/94515] " nsz at gcc dot gnu.org
2020-04-27  8:11 ` cvs-commit at gcc dot gnu.org [this message]
2020-05-14 15:17 ` cvs-commit at gcc dot gnu.org
2020-05-14 15:48 ` cvs-commit at gcc dot gnu.org
2020-05-14 15:51 ` nsz at gcc dot gnu.org
2020-05-14 15:52 ` nsz at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-94515-4-H7J2rpKpA9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).