selftests/x86/test_vsyscall: Improve the process_vm_readv() test
authorAndy Lutomirski <luto@kernel.org>
Thu, 3 Sep 2020 20:40:30 +0000 (13:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 5 Sep 2020 09:24:02 +0000 (11:24 +0200)
commit20257b70d5f154a480b542150720d6f54fad2ca5
treefb6a05f05e463f4f1ab760a8740e8cdd2c74c792
parente80a7602b405dfac44aa4e81eec6d51d9e9fad8e
selftests/x86/test_vsyscall: Improve the process_vm_readv() test

commit 8891adc61dce2a8a41fc0c23262b681c3ec4b73a upstream.

The existing code accepted process_vm_readv() success or failure as long
as it didn't return garbage.  This is too weak: if the vsyscall page is
readable, then process_vm_readv() should succeed and, if the page is not
readable, then it should fail.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Jann Horn <jannh@google.com>
Cc: John Hubbard <jhubbard@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
tools/testing/selftests/x86/test_vsyscall.c