Source-Changes-HG archive

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

[src/trunk]: src/sys/kern disallow ktrace on P_SUGID. from openbsd



details:   https://anonhg.NetBSD.org/src/rev/2c7b63753a67
branches:  trunk
changeset: 533348:2c7b63753a67
user:      itojun <itojun%NetBSD.org@localhost>
date:      Fri Jun 28 01:59:36 2002 +0000

description:
disallow ktrace on P_SUGID.  from openbsd

diffstat:

 sys/kern/kern_ktrace.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r fba6afb6bf01 -r 2c7b63753a67 sys/kern/kern_ktrace.c
--- a/sys/kern/kern_ktrace.c    Fri Jun 28 01:10:06 2002 +0000
+++ b/sys/kern/kern_ktrace.c    Fri Jun 28 01:59:36 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_ktrace.c,v 1.57 2002/06/18 08:01:30 fvdl Exp $    */
+/*     $NetBSD: kern_ktrace.c,v 1.58 2002/06/28 01:59:36 itojun Exp $  */
 
 /*
  * Copyright (c) 1989, 1993
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.57 2002/06/18 08:01:30 fvdl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_ktrace.c,v 1.58 2002/06/28 01:59:36 itojun Exp $");
 
 #include "opt_ktrace.h"
 
@@ -655,7 +655,8 @@
             target->p_ruid == target->p_svuid &&
             caller->p_rgid == target->p_rgid &&        /* XXX */
             target->p_rgid == target->p_svgid &&
-            (targetp->p_traceflag & KTRFAC_ROOT) == 0) ||
+            (targetp->p_traceflag & KTRFAC_ROOT) == 0 &&
+            (targetp->p_flag & P_SUGID) == 0) ||
             caller->pc_ucred->cr_uid == 0)
                return (1);
 



Home | Main Index | Thread Index | Old Index