Re: [PATCH v2] x86/bugs: Default retbleed to =stuff when retpoline is enabled

From: Pawan Gupta
Date: Mon Feb 12 2024 - 23:53:38 EST


On Mon, Feb 12, 2024 at 05:23:21PM -0800, Pawan Gupta wrote:
> On Intel systems when retpoline mitigation is enabled for spectre-v2,
> retbleed=auto does not enable RSB stuffing. This may make the system
> vulnerable to retbleed. Retpoline is not the default mitigation when
> IBRS is present, but in virtualized cases a VMM can hide IBRS from
> guests, resulting in guest deploying retpoline by default. Even if IBRS
> is enumerated, a user can still select spectre_v2=retpoline.
>
> As with other mitigations, mitigate retbleed by default. On Intel
> systems when retpoline is enabled, and retbleed mitigation is set to
> auto, enable Call Depth Tracking and RSB stuffing i.e. retbleed=stuff
> mitigation. For AMD/Hygon auto mode already selects the appropriate
> mitigation.

By mistake I sent this patch twice, please ignore the duplicate:

https://lore.kernel.org/lkml/20240213042453.6j01GG4kjjcdTev7AtniyPHPRNH3RFHNGgVJ5nIXho4@z/