Re: [PATCH 1/2] Documentation: clarify PR_SPEC_L1D_FLUSH

From: Josh Poimboeuf

Date: Wed Oct 15 2025 - 19:42:44 EST


On Wed, Oct 15, 2025 at 02:41:18PM -0700, Kees Cook wrote:
> On Wed, Oct 15, 2025 at 05:02:05PM +0000, Brendan Jackman wrote:
> > For PR_SPEC_STORE_BYPASS and PR_SPEC_INDIRECT_BRANCH, PR_SPEC_DISABLE
> > means "disable the speculation bug" i.e. "enable the mitigation".
> >
> > For PR_SPEC_L1D_FLUSH, PR_SPEC_DISABLE means "disable the mitigation".
> > This is not obvious, so document it.
>
> The only thing I can find in Debian Code Search that actually uses
> PR_SPEC_L1D_FLUSH is stress-ng, and it literally just toggles it before
> restoring it:
> https://sources.debian.org/src/stress-ng/0.19.05-1/stress-prctl.c?hl=893#L893
>
> I wonder if we should just fix the prctl to match the existing
> behaviors?

This feature has existed for almost 5 years, I don't think we can just
reverse the functionality like that? There could be proprietary users
out there (e.g., cloud companies).

--
Josh