• Andy Lutomirski's avatar
    x86, selftests: Add a test for the "sysret_ss_attrs" bug · e22438f8
    Andy Lutomirski authored
    
    
    On AMD CPUs, SYSRET can return with a valid SS descriptor with
    with the hidden attributes set to an unusable state.  Make sure
    the kernel doesn't let this happen.  This detects an
    as-yet-unfixed regression.
    
    Note that the 64-bit version of this test fails on AMD CPUs on
    all kernel versions, although the issue in the 64-bit case is
    much less severe than in the 32-bit case.
    Reported-by: default avatarBrian Gerst <brgerst@gmail.com>
    Tested-by: default avatarDenys Vlasenko <dvlasenk@redhat.com>
    Signed-off-by: default avatarAndy Lutomirski <luto@kernel.org>
    Tests: e7d6eefa ("x86/vdso32/syscall.S: Do not load __USER32_DS to %ss")
    Cc: Alexei Starovoitov <ast@plumgrid.com>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: Denys Vlasenko <vda.linux@googlemail.com>
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Kees Cook <keescook@chromium.org>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Oleg Nesterov <oleg@redhat.com>
    Cc: Peter Zijlstra <peterz@in...
    e22438f8
sysret_ss_attrs.c 2.86 KB