From: Xin Li <xin@zytor.com>
To: Andrew Cooper <andrew.cooper3@citrix.com>, linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de,
dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com,
peterz@infradead.org
Subject: Re: [PATCH v2 1/1] x86/fred: Clear WFE in missing-ENDBRANCH #CPs
Date: Mon, 11 Nov 2024 18:53:09 -0800 [thread overview]
Message-ID: <6735d24c-b031-499d-b298-ef8861b4daba@zytor.com> (raw)
In-Reply-To: <473f9dae-b711-4d96-8804-209275b963a2@citrix.com>
On 11/8/2024 12:53 PM, Andrew Cooper wrote:
>> Andrew,
>>
>> can you please take another look?
> After discussing with Dave on IRC, the ibt_clear_fred_wfe(regs); really
> needs to be inside the ibt_selftest_noendbr path.
>
Sigh, I missed the discussion.
> It's a selftest where we're deliberately trying to trigger #CP, and in
> the one case where we're happy should we say "yeah, safe to clobber WFE
> in the interrupted context" to let execution continue.
>
> Clobbering WFE in any other circumstance is a security-relevant bug.
I think we also need to clear WFE when !ibt_fatal. No?
diff --git a/arch/x86/kernel/cet.c b/arch/x86/kernel/cet.c
index fb8f4238969e..69a34636811f 100644
--- a/arch/x86/kernel/cet.c
+++ b/arch/x86/kernel/cet.c
@@ -128,6 +128,7 @@ static void do_kernel_cp_fault(struct pt_regs *regs,
unsigned long error_code)
if (!ibt_fatal) {
printk(KERN_DEFAULT CUT_HERE);
__warn(__FILE__, __LINE__, (void *)regs->ip, TAINT_WARN, regs, NULL);
+ ibt_clear_fred_wfe(regs);
return;
}
BUG();
next prev parent reply other threads:[~2024-11-12 2:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 18:10 Xin Li (Intel)
2024-11-07 18:54 ` Xin Li
2024-11-07 18:57 ` Dave Hansen
2024-11-08 20:53 ` Andrew Cooper
2024-11-12 2:53 ` Xin Li [this message]
2024-11-07 20:51 ` Dave Hansen
2024-11-08 2:02 ` Andrew Cooper
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=6735d24c-b031-499d-b298-ef8861b4daba@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=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.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®