]> git.baikalelectronics.ru Git - kernel.git/commit
proc: fix test for "vsyscall=xonly" boot option
authorAlexey Dobriyan <adobriyan@gmail.com>
Tue, 12 Jul 2022 14:51:45 +0000 (17:51 +0300)
committerakpm <akpm@linux-foundation.org>
Mon, 18 Jul 2022 00:31:43 +0000 (17:31 -0700)
commit243c6c615dc5717fb155f9763d6d329ed4add29d
tree2186b0a88121c1e8653c06e7fefd627a76ecde54
parenta08693956b15051d99b1d0bb36c67018a127e95e
proc: fix test for "vsyscall=xonly" boot option

Booting with vsyscall=xonly results in the following vsyscall VMA:

ffffffffff600000-ffffffffff601000 --xp ... [vsyscall]

Test does read from fixed vsyscall address to determine if kernel
supports vsyscall page but it doesn't work because, well, vsyscall
page is execute only.

Fix test by trying to execute from the first byte of the page which
contains gettimeofday() stub. This should work because vsyscall
entry points have stable addresses by design.

Alexey, avoiding parsing .config, /proc/config.gz and
/proc/cmdline at all costs.

Link: https://lkml.kernel.org/r/Ys2KgeiEMboU8Ytu@localhost.localdomain
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Shuah Khan <skhan@linuxfoundation.org>
Cc: <dylanbhatch@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
tools/testing/selftests/proc/proc-pid-vm.c