public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/115389] New: Invalid ROP hashst offset is emitted when using -mabi=no-altivec
@ 2024-06-07 21:34 bergner at gcc dot gnu.org
  2024-06-07 21:36 ` [Bug target/115389] " bergner at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bergner at gcc dot gnu.org @ 2024-06-07 21:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115389
           Summary: Invalid ROP hashst offset is emitted when using
                    -mabi=no-altivec
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bergner at gcc dot gnu.org
  Target Milestone: ---

We emit a hashst instruction with an invalid offset when compiling with
-mabi=no-altivec.

bergner@ltcd97-lp3:~/ROP$ cat bug.c 
extern void foo (void);
long
bar (void)
{
  foo ();
  return 0;
}
bergner@ltcd97-lp3:~/ROP$ gcc -c -O2 -mcpu=power10 -mrop-protect -mno-vsx
-mno-altivec -mabi=altivec bug.c
bergner@ltcd97-lp3:~/ROP$ gcc -c -O2 -mcpu=power10 -mrop-protect -mno-vsx
-mno-altivec -mabi=no-altivec bug.c 
/tmp/ccSzxbv5.s: Assembler messages:
/tmp/ccSzxbv5.s:15: Error: invalid offset: must be in the range [-512, -8] and
be a multiple of 8
/tmp/ccSzxbv5.s:25: Error: invalid offset: must be in the range [-512, -8] and
be a multiple of 8

The bug is we only compute the ROP hash save slot offset when
TARGET_ALTIVEC_ABI is true. If TARGET_ALTIVEC_ABI is false and we enable ROP
mitigation, then we use the initialized value of zero which is an illegal
offset value for hashst and hashchk.

This has been broken since the rs6000 ROP mitigation code was first added, so
not a regression.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-06-17 13:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-07 21:34 [Bug target/115389] New: Invalid ROP hashst offset is emitted when using -mabi=no-altivec bergner at gcc dot gnu.org
2024-06-07 21:36 ` [Bug target/115389] " bergner at gcc dot gnu.org
2024-06-11 22:54 ` segher at gcc dot gnu.org
2024-06-11 22:55 ` segher at gcc dot gnu.org
2024-06-12  3:16 ` bergner at gcc dot gnu.org
2024-06-17 13:14 ` cvs-commit at gcc dot gnu.org
2024-06-17 13:15 ` bergner at gcc dot gnu.org

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).