Skip to content

Commit 630b99a

Browse files
amlutosuryasaimadhu
authored andcommitted
selftests/x86/ptrace_syscall_32: Fix no-vDSO segfault
If AT_SYSINFO is not present, don't try to call a NULL pointer. Reported-by: kbuild test robot <[email protected]> Signed-off-by: Andy Lutomirski <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lkml.kernel.org/r/faaf688265a7e1a5b944d6f8bc0f6368158306d3.1584052409.git.luto@kernel.org
1 parent 07f24dc commit 630b99a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

tools/testing/selftests/x86/ptrace_syscall.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,8 +414,12 @@ int main()
414414

415415
#if defined(__i386__) && (!defined(__GLIBC__) || __GLIBC__ > 2 || __GLIBC_MINOR__ >= 16)
416416
vsyscall32 = (void *)getauxval(AT_SYSINFO);
417-
printf("[RUN]\tCheck AT_SYSINFO return regs\n");
418-
test_sys32_regs(do_full_vsyscall32);
417+
if (vsyscall32) {
418+
printf("[RUN]\tCheck AT_SYSINFO return regs\n");
419+
test_sys32_regs(do_full_vsyscall32);
420+
} else {
421+
printf("[SKIP]\tAT_SYSINFO is not available\n");
422+
}
419423
#endif
420424

421425
test_ptrace_syscall_restart();

0 commit comments

Comments
 (0)