From b41b63a9d9d92cd402c6f284bc6d1affc6e99da7 Mon Sep 17 00:00:00 2001 From: Fuhai Wang Date: Wed, 21 Jul 2021 15:46:06 +0800 Subject: [PATCH] Revert "selftests/x86/fsgsbase: Test ptracer-induced GS base write with FSGSBASE" This reverts commit 5bc369e5a024d0aa2f5a27a1bb77a30a1c0db51d. --- tools/testing/selftests/x86/fsgsbase.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/tools/testing/selftests/x86/fsgsbase.c b/tools/testing/selftests/x86/fsgsbase.c index 05971e3ae..37a7a65d2 100644 --- a/tools/testing/selftests/x86/fsgsbase.c +++ b/tools/testing/selftests/x86/fsgsbase.c @@ -527,7 +527,7 @@ static void test_ptrace_write_gsbase(void) wait(&status); if (WSTOPSIG(status) == SIGTRAP) { - unsigned long gs, base; + unsigned long gs; unsigned long gs_offset = USER_REGS_OFFSET(gs); unsigned long base_offset = USER_REGS_OFFSET(gs_base); @@ -543,7 +543,6 @@ static void test_ptrace_write_gsbase(void) err(1, "PTRACE_POKEUSER"); gs = ptrace(PTRACE_PEEKUSER, child, gs_offset, NULL); - base = ptrace(PTRACE_PEEKUSER, child, base_offset, NULL); /* * In a non-FSGSBASE system, the nonzero selector will load @@ -564,14 +563,8 @@ static void test_ptrace_write_gsbase(void) */ if (gs == 0) printf("\tNote: this is expected behavior on older kernels.\n"); - } else if (have_fsgsbase && (base != 0xFF)) { - nerrs++; - printf("[FAIL]\tGSBASE changed to %lx\n", base); } else { - printf("[OK]\tGS remained 0x%hx", *shared_scratch); - if (have_fsgsbase) - printf(" and GSBASE changed to 0xFF"); - printf("\n"); + printf("[OK]\tGS remained 0x%hx\n", *shared_scratch); } }