From: Xin Li <xin@zytor.com>
To: linux-kernel@vger.kernel.org
Cc: luto@kernel.org, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
hpa@zytor.com, jmill@asu.edu, peterz@infradead.org,
andrew.cooper3@citrix.com, stable@vger.kernel.org
Subject: Re: [PATCH v3 1/1] x86/fred: Remove ENDBR64 from FRED entry points
Date: Mon, 11 Aug 2025 15:48:47 -0700 [thread overview]
Message-ID: <d1f20289-a6d6-44d6-988f-08fb87faa067@zytor.com> (raw)
In-Reply-To: <20250716063320.1337818-1-xin@zytor.com>
On 7/15/2025 11:33 PM, Xin Li (Intel) wrote:
> The FRED specification has been changed in v9.0 to state that there
> is no need for FRED event handlers to begin with ENDBR64, because
> in the presence of supervisor indirect branch tracking, FRED event
> delivery does not enter the WAIT_FOR_ENDBRANCH state.
>
> As a result, remove ENDBR64 from FRED entry points.
>
> Then add ANNOTATE_NOENDBR to indicate that FRED entry points will
> never be used for indirect calls to suppress an objtool warning.
>
> This change implies that any indirect CALL/JMP to FRED entry points
> causes #CP in the presence of supervisor indirect branch tracking.
>
> Credit goes to Jennifer Miller <jmill@asu.edu> and other contributors
> from Arizona State University whose research shows that placing ENDBR
> at entry points has negative value thus led to this change.
>
> Fixes: 14619d912b65 ("x86/fred: FRED entry/exit and dispatch code")
> Link: https://lore.kernel.org/linux-hardening/Z60NwR4w%2F28Z7XUa@ubun/
> Reviewed-by: H. Peter Anvin (Intel) <hpa@zytor.com>
> Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
> Signed-off-by: Xin Li (Intel) <xin@zytor.com>
> Cc: Jennifer Miller <jmill@asu.edu>
> Cc: Peter Zijlstra <peterz@infradead.org>
> Cc: Andrew Cooper <andrew.cooper3@citrix.com>
> Cc: H. Peter Anvin <hpa@zytor.com>
> Cc: stable@vger.kernel.org # v6.9+
> ---
>
> Change in v3:
> *) Revise the FRED spec change description to clearly indicate that it
> deviates from previous versions and is based on new research showing
> that placing ENDBR at entry points has negative value (Andrew Cooper).
>
> Change in v2:
> *) CC stable and add a fixes tag (PeterZ).
> ---
> arch/x86/entry/entry_64_fred.S | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/entry/entry_64_fred.S b/arch/x86/entry/entry_64_fred.S
> index 29c5c32c16c3..907bd233c6c1 100644
> --- a/arch/x86/entry/entry_64_fred.S
> +++ b/arch/x86/entry/entry_64_fred.S
> @@ -16,7 +16,7 @@
>
> .macro FRED_ENTER
> UNWIND_HINT_END_OF_STACK
> - ENDBR
> + ANNOTATE_NOENDBR
> PUSH_AND_CLEAR_REGS
> movq %rsp, %rdi /* %rdi -> pt_regs */
> .endm
Ping :)
next prev parent reply other threads:[~2025-08-11 22:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-16 6:33 Xin Li (Intel)
2025-08-11 22:48 ` Xin Li [this message]
2025-08-13 21:07 ` Dave Hansen
2025-08-13 21:57 ` H. Peter Anvin
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=d1f20289-a6d6-44d6-988f-08fb87faa067@zytor.com \
--to=xin@zytor.com \
--cc=andrew.cooper3@citrix.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=hpa@zytor.com \
--cc=jmill@asu.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=x86@kernel.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
all inboxes | Powered by JetHome®