Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit4b0b37d

Browse files
amlutoIngo Molnar
authored and
Ingo Molnar
committed
selftests/x86/ptrace_syscall: Fix for yet more glibc interference
glibc keeps getting cleverer, and my version now turns raise() intomore than one syscall. Since the test relies on ptrace seeing anexact set of syscalls, this breaks the test. Replace raise(SIGSTOP)with syscall(SYS_tgkill, ...) to force glibc to get out of our way.Signed-off-by: Andy Lutomirski <luto@kernel.org>Cc: Borislav Petkov <bp@alien8.de>Cc: Linus Torvalds <torvalds@linux-foundation.org>Cc: Peter Zijlstra <peterz@infradead.org>Cc: Thomas Gleixner <tglx@linutronix.de>Cc: linux-kselftest@vger.kernel.orgCc: stable@vger.kernel.orgLink:http://lkml.kernel.org/r/bc80338b453afa187bc5f895bd8e2c8d6e264da2.1521300271.git.luto@kernel.orgSigned-off-by: Ingo Molnar <mingo@kernel.org>
1 parentbb8c13d commit4b0b37d

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
@@ -183,8 +183,10 @@ static void test_ptrace_syscall_restart(void)
183183
if (ptrace(PTRACE_TRACEME,0,0,0)!=0)
184184
err(1,"PTRACE_TRACEME");
185185

186+
pid_tpid=getpid(),tid=syscall(SYS_gettid);
187+
186188
printf("\tChild will make one syscall\n");
187-
raise(SIGSTOP);
189+
syscall(SYS_tgkill,pid,tid,SIGSTOP);
188190

189191
syscall(SYS_gettid,10,11,12,13,14,15);
190192
_exit(0);
@@ -301,9 +303,11 @@ static void test_restart_under_ptrace(void)
301303
if (ptrace(PTRACE_TRACEME,0,0,0)!=0)
302304
err(1,"PTRACE_TRACEME");
303305

306+
pid_tpid=getpid(),tid=syscall(SYS_gettid);
307+
304308
printf("\tChild will take a nap until signaled\n");
305309
setsigign(SIGUSR1,SA_RESTART);
306-
raise(SIGSTOP);
310+
syscall(SYS_tgkill,pid,tid,SIGSTOP);
307311

308312
syscall(SYS_pause,0,0,0,0,0,0);
309313
_exit(0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp