Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/sys Simplify the x86_64_cve_2018...



details:   https://anonhg.NetBSD.org/src/rev/39c9cdf4a9c9
branches:  trunk
changeset: 319032:39c9cdf4a9c9
user:      kamil <kamil%NetBSD.org@localhost>
date:      Mon May 14 12:42:34 2018 +0000
description:
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>

diffstat:

 tests/lib/libc/sys/t_ptrace_amd64_wait.h |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 771e8e49ea9e -r 39c9cdf4a9c9 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);
 



Home | Main Index | Thread Index | Old Index