]> www.infradead.org Git - users/dwmw2/linux.git/commit
selftests/x86/mov_ss_trap: Fix the SYSENTER test
authorAndy Lutomirski <luto@kernel.org>
Wed, 20 Nov 2019 20:59:13 +0000 (12:59 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2019 09:09:58 +0000 (10:09 +0100)
commit72e521b167ffba300d3381699718f8757e5559e7
tree3bd33ff78cb038268c0b5a8980dfd21ae6cc896c
parente74c494a20df1fbd096d3fa60e39bc3f06863bd6
selftests/x86/mov_ss_trap: Fix the SYSENTER test

commit 8caa016bfc129f2c925d52da43022171d1d1de91 upstream.

For reasons that I haven't quite fully diagnosed, running
mov_ss_trap_32 on a 32-bit kernel results in an infinite loop in
userspace.  This appears to be because the hacky SYSENTER test
doesn't segfault as desired; instead it corrupts the program state
such that it infinite loops.

Fix it by explicitly clearing EBP before doing SYSENTER.  This will
give a more reliable segfault.

Fixes: 59c2a7226fc5 ("x86/selftests: Add mov_to_ss test")
Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/x86/mov_ss_trap.c