lkml.org 
[lkml]   [2022]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 5.15 06/43] x86/speculation: Use generic retpoline by default on AMD
    Date
    From: Kim Phillips <kim.phillips@amd.com>

    commit 244d00b5dd4755f8df892c86cab35fb2cfd4f14b 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.

    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>
    ---
    arch/x86/kernel/cpu/bugs.c | 9 ---------
    1 file changed, 9 deletions(-)

    --- a/arch/x86/kernel/cpu/bugs.c
    +++ b/arch/x86/kernel/cpu/bugs.c
    @@ -941,15 +941,6 @@ static enum spectre_v2_mitigation __init
    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;
    }


    \
     
     \ /
      Last update: 2022-03-09 17:23    [W:5.113 / U:1.728 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site