From: Borislav Petkov <bp@alien8.de>
To: Daniel Verkamp <dverkamp@chromium.org>
Cc: x86@kernel.org, linux-kernel@vger.kernel.org,
Tony Luck <tony.luck@intel.com>
Subject: Re: [PATCH] x86: also disable FSRM if ERMS is disabled
Date: Fri, 23 Sep 2022 13:13:28 +0200 [thread overview]
Message-ID: <Yy2U2BW6Tx0imGpK@zn.tnic> (raw)
In-Reply-To: <20220923005827.1533380-1-dverkamp@chromium.org>
On Thu, Sep 22, 2022 at 05:58:27PM -0700, Daniel Verkamp wrote:
> In the "Fast Short REP MOVSB" path of memmove, if we take the path where
> the FSRM flag is enabled but the ERMS flag is not, there is no longer a
> check for length >= 0x20 (both alternatives will be replaced with NOPs).
> If a memmove() requiring a forward copy of less than 0x20 bytes happens
> in this case, the `sub $0x20, %rdx` will cause the length to roll around
> to a huge value and the copy will eventually hit a page fault.
>
> This is not intended to happen, as the comment above the alternatives
> mentions "FSRM implies ERMS".
>
> However, there is a check in early_init_intel() that can disable ERMS,
> so we should also be disabling FSRM in this path to maintain correctness
> of the memmove() optimization.
Is this something you hit in a real-world scenario? If so, how exactly?
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
next prev parent reply other threads:[~2022-09-23 11:13 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-23 0:58 [PATCH] x86: also disable FSRM if ERMS is disabled Daniel Verkamp
2022-09-23 11:13 ` Borislav Petkov [this message]
2022-09-23 17:25 ` Daniel Verkamp
2022-09-23 17:51 ` Borislav Petkov
2022-10-07 18:08 ` Daniel Verkamp
2022-10-11 11:28 ` Borislav Petkov
2022-10-11 17:09 ` Luck, Tony
2022-10-11 17:52 ` Borislav Petkov
2022-10-11 19:08 ` Luck, Tony
2022-10-11 20:56 ` Borislav Petkov
2022-10-11 22:19 ` Luck, Tony
2022-10-11 22:59 ` Andrew Cooper
2023-01-04 7:43 ` Jiri Slaby
2023-01-04 11:39 ` Borislav Petkov
2023-01-14 9:19 ` Ingo Molnar
2023-01-14 9:58 ` Borislav Petkov
2023-01-16 5:26 ` Jiri Slaby
2023-01-16 21:17 ` Borislav Petkov
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=Yy2U2BW6Tx0imGpK@zn.tnic \
--to=bp@alien8.de \
--cc=dverkamp@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@intel.com \
--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