public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/104816] New: -fcf-protection=branch should generate endbr instead of notrack jumps
@ 2022-03-07 11:48 joao at overdrivepizza dot com
  2022-03-07 12:15 ` [Bug target/104816] " joao at overdrivepizza dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: joao at overdrivepizza dot com @ 2022-03-07 11:48 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104816
           Summary: -fcf-protection=branch should generate endbr instead
                    of notrack jumps
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: joao at overdrivepizza dot com
  Target Milestone: ---

When -fcf-protection=branch is used, the compiler will generate jump tables
where the indirect jump is prefixed with the NOTRACK prefix, so it can jump to
non-ENDBR targets. Yet, for NOTRACK prefixes to work, the NOTRACK specific
enable bit must be set, what renders the binary broken on any environment where
this is not the case. In fact, having NOTRACK disabled was a design choice for
the Linux kernel CET support [https://lkml.org/lkml/2022/3/7/1068].

With the above, the compiler should generate jump tables with ENDBRs, for
proper correctness. And, if security regarding the additional ENDBRs is a
concern, the code can be explicitly compiled with -fno-jump-tables.

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

end of thread, other threads:[~2024-01-18  9:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-07 11:48 [Bug c/104816] New: -fcf-protection=branch should generate endbr instead of notrack jumps joao at overdrivepizza dot com
2022-03-07 12:15 ` [Bug target/104816] " joao at overdrivepizza dot com
2022-03-07 13:53 ` rguenth at gcc dot gnu.org
2022-03-07 14:06 ` hjl.tools at gmail dot com
2022-03-07 14:18 ` andrew.cooper3 at citrix dot com
2022-03-07 14:23 ` hjl.tools at gmail dot com
2022-03-07 14:27 ` peterz at infradead dot org
2022-03-07 14:38 ` andrew.cooper3 at citrix dot com
2022-03-11 20:43 ` hjl.tools at gmail dot com
2022-03-11 20:58 ` hjl.tools at gmail dot com
2022-03-13 15:09 ` hjl.tools at gmail dot com
2022-05-24 16:06 ` cvs-commit at gcc dot gnu.org
2022-05-24 18:12 ` peterz at infradead dot org
2024-01-18  9:06 ` i at maskray dot me

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