Re: [RFC PATCH 27/34] x86/bugs: Add attack vector controls for spectre_v1

From: Borislav Petkov
Date: Fri Sep 13 2024 - 10:20:38 EST


On Thu, Sep 12, 2024 at 07:57:50PM +0000, Kaplan, David wrote:
> > There's also added complexity from having 'enum vulnerabilities' which
> > basically duplicate the X86_BUG_* space. If the infrastructure was, for
> > instance, built around X86_BUG bits, it might have enabled this patch to be
> > something like:
> >
> > - if (!boot_cpu_has_bug(X86_BUG_SPECTRE_V1) ||
> > - cpu_mitigations_off())
> > + if (!should_mitigate_vuln(X86_BUG_SPECTRE_V1))
> > spectre_v1_mitigation = SPECTRE_V1_MITIGATION_NONE;
>
> That's a reasonable idea. One issue I see is that there is no separation in
> the X86_BUG* space for spectre_v2 vs spectre_v2_user, but they do have
> separate mitigations. But I think that is the only missing one, so maybe it
> just makes sense to add a X86_BUG bit for that?

I think we should do that. That's less complexity in the mitigations area and
those are always welcome.

Thx.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette