Simplify the x86_64_cve_2018_8897 ATF ptrace(2) test trunk
authorkamil <kamil@NetBSD.org>
Mon, 14 May 2018 12:42:34 +0000
branchtrunk
changeset 319032 39c9cdf4a9c9
parent 319031 771e8e49ea9e
child 319033 c6823766b282
Simplify the x86_64_cve_2018_8897 ATF ptrace(2) test Do not call _exit() from the child, ad this code shall not be reached. Put there assert(). No functional change. The test still passes. Sponsored by <The NetBSD Foundation>
tests/lib/libc/sys/t_ptrace_amd64_wait.h
--- a/tests/lib/libc/sys/t_ptrace_amd64_wait.h	Mon May 14 09:21:36 2018 +0000
+++ b/tests/lib/libc/sys/t_ptrace_amd64_wait.h	Mon May 14 12:42:34 2018 +0000
@@ -1,4 +1,4 @@
-/*	$NetBSD: t_ptrace_amd64_wait.h,v 1.3 2018/05/13 23:14:47 kamil Exp $	*/
+/*	$NetBSD: t_ptrace_amd64_wait.h,v 1.4 2018/05/14 12:42:34 kamil Exp $	*/
 
 /*-
  * Copyright (c) 2016 The NetBSD Foundation, Inc.
@@ -239,7 +239,6 @@
 
 ATF_TC_BODY(x86_64_cve_2018_8897, tc)
 {
-	const int exitval = 5;
 	const int sigval = SIGSTOP;
 	pid_t child, wpid;
 #if defined(TWAIT_HAVE_STATUS)
@@ -274,8 +273,8 @@
 
 		trigger_cve_2018_8897();
 
-		DPRINTF("Before exiting of the child process\n");
-		_exit(exitval);
+		/* NOTREACHED */
+		FORKEE_ASSERTX(0 && "This shall not be reached");
 	}
 	DPRINTF("Parent process PID=%d, child's PID=%d\n", getpid(), child);