OSDN Git Service

selftests/seccomp: allow clock_nanosleep instead of nanosleep
authorThadeu Lima de Souza Cascardo <cascardo@canonical.com>
Wed, 8 Apr 2020 23:57:53 +0000 (20:57 -0300)
committerShuah Khan <skhan@linuxfoundation.org>
Tue, 14 Apr 2020 15:49:51 +0000 (09:49 -0600)
commitd42b8dbec46c08c6bd3f9d264127bd4910581c07
tree4f5ff9935105c7a553a3ea2199a7fe7284fad6d8
parent651e0d881461ab2b1cd5cbec3a642d22fc8d6057
selftests/seccomp: allow clock_nanosleep instead of nanosleep

glibc 2.31 calls clock_nanosleep when its nanosleep function is used. So
the restart_syscall fails after that. In order to deal with it, we trace
clock_nanosleep and nanosleep. Then we check for either.

This works just fine on systems with both glibc 2.30 and glibc 2.31,
whereas it failed before on a system with glibc 2.31.

Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
Acked-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/seccomp/seccomp_bpf.c