public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: "H.J. Lu via Gcc-patches" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] x86: Document -mno-cet-switch
Date: Wed, 11 May 2022 10:12:22 +0200	[thread overview]
Message-ID: <87sfpgij2x.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20220510162049.2686945-1-hjl.tools@gmail.com> (H. J. Lu via Gcc-patches's message of "Tue, 10 May 2022 09:20:49 -0700")

* H. J. Lu via Gcc-patches:

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

Why isn't that a kernel bug?  It doesn't match what is in the current
glibc sources.

> Generate jump tables with ENDBR and skip the NOTRACK prefix for indirect
> jump.  Document -mno-cet-switch to turn off CET instrumentation on jump
> tables for switch statements.

Of course, that is a slight regression in security hardening.

Quite frankly, I'm puzzled why the kernel decided to require these
additional ENDBR instructions.

Thanks,
Florian


  parent reply	other threads:[~2022-05-11  8:12 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10 16:20 H.J. Lu
2022-05-11  7:15 ` Uros Bizjak
2022-05-11  8:12 ` Florian Weimer [this message]
2022-05-11 14:20   ` H.J. Lu
2022-05-11 15:58     ` Florian Weimer
2022-05-11 18:00       ` H.J. Lu
2022-05-11 18:22         ` Florian Weimer
2022-05-11 18:36           ` H.J. Lu
2022-05-11 18:45             ` Florian Weimer
2022-05-11 18:57               ` H.J. Lu
2022-05-11 19:02                 ` Florian Weimer
2022-05-11 20:04                   ` H.J. Lu
2022-05-12  7:15                   ` Richard Biener
2022-05-12 16:42                     ` H.J. Lu

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=87sfpgij2x.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=gcc-patches@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).