You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
UPSTREAM: x86/speculation: Use generic retpoline by default on AMD
commit 244d00b5dd upstream.
AMD retpoline may be susceptible to speculation. The speculation
execution window for an incorrect indirect branch prediction using
LFENCE/JMP sequence may potentially be large enough to allow
exploitation using Spectre V2.
By default, don't use retpoline,lfence on AMD. Instead, use the
generic retpoline.
Bug: 215557547
Signed-off-by: Kim Phillips <kim.phillips@amd.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ia055414ec9ab24eeebb21e799cc220cce8a1f3f6
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
bd02dc4329
commit
c4188388a3
@@ -904,15 +904,6 @@ static enum spectre_v2_mitigation __init spectre_v2_select_retpoline(void)
|
||||
return SPECTRE_V2_NONE;
|
||||
}
|
||||
|
||||
if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD ||
|
||||
boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) {
|
||||
if (!boot_cpu_has(X86_FEATURE_LFENCE_RDTSC)) {
|
||||
pr_err("LFENCE not serializing, switching to generic retpoline\n");
|
||||
return SPECTRE_V2_RETPOLINE;
|
||||
}
|
||||
return SPECTRE_V2_LFENCE;
|
||||
}
|
||||
|
||||
return SPECTRE_V2_RETPOLINE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user