Source-Changes-HG archive

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

[src/netbsd-9]: src/sys/kern Pull up following revision(s) (requested by kami...



details:   https://anonhg.NetBSD.org/src/rev/1aaf59a500df
branches:  netbsd-9
changeset: 458493:1aaf59a500df
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Oct 15 19:03:20 2019 +0000

description:
Pull up following revision(s) (requested by kamil in ticket #321):

        sys/kern/sys_ptrace_common.c: revision 1.63

Add two KASSERTS in the ptrace(2) kernel code

Verify that we will never return empty ptrace_state for CHILD/LWP event.

diffstat:

 sys/kern/sys_ptrace_common.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 41ba15b10ac8 -r 1aaf59a500df sys/kern/sys_ptrace_common.c
--- a/sys/kern/sys_ptrace_common.c      Tue Oct 15 19:01:06 2019 +0000
+++ b/sys/kern/sys_ptrace_common.c      Tue Oct 15 19:03:20 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sys_ptrace_common.c,v 1.58.2.5 2019/10/15 19:01:06 martin Exp $        */
+/*     $NetBSD: sys_ptrace_common.c,v 1.58.2.6 2019/10/15 19:03:20 martin Exp $        */
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -118,7 +118,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.58.2.5 2019/10/15 19:01:06 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.58.2.6 2019/10/15 19:03:20 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ptrace.h"
@@ -702,6 +702,10 @@
                memset(&ps, 0, sizeof(ps));
        } else {
                si = &t->p_sigctx.ps_info;
+
+               KASSERT(si->_reason._ptrace_state._pe_report_event > 0);
+               KASSERT(si->_reason._ptrace_state._option._pe_other_pid > 0);
+
                ps.pe_report_event = si->_reason._ptrace_state._pe_report_event;
 
                CTASSERT(sizeof(ps.pe_other_pid) == sizeof(ps.pe_lwp));



Home | Main Index | Thread Index | Old Index