From brooks@minya.sea.one-eyed-alien.net  Wed Nov  8 23:16:19 2000
Return-Path: <brooks@minya.sea.one-eyed-alien.net>
Received: from minya.sea.one-eyed-alien.net (minya.sea.one-eyed-alien.net [216.39.168.226])
	by hub.freebsd.org (Postfix) with ESMTP
	id F153637B479; Wed,  8 Nov 2000 23:16:18 -0800 (PST)
Received: (from brooks@localhost)
	by minya.sea.one-eyed-alien.net (8.11.1/8.11.1) id eA97HHK00634;
	Wed, 8 Nov 2000 23:17:17 -0800 (PST)
	(envelope-from brooks)
Message-Id: <200011090717.eA97HHK00634@minya.sea.one-eyed-alien.net>
Date: Wed, 8 Nov 2000 23:17:17 -0800 (PST)
From: brooks@one-eyed-alien.net
Sender: brooks@minya.sea.one-eyed-alien.net
Reply-To: brooks@one-eyed-alien.net
To: FreeBSD-gnats-submit@freebsd.org
Cc: rwatson@freebsd.org
Subject: [PATCH] non-root users can't debug
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         22711
>Category:       kern
>Synopsis:       [PATCH] non-root users can't debug
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    rwatson
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Nov 08 23:20:01 PST 2000
>Closed-Date:    Sun Dec 17 13:31:39 PST 2000
>Last-Modified:  Sun Dec 17 13:33:25 PST 2000
>Originator:     Brooks Davis
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
The Aerospace Corp
>Environment:
System: FreeBSD minya 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed Nov 8 22:52:59 PST 2000 root@minya:/usr/obj/usr/src/sys/MINYA i386


>Description:

Attempting to run gdb on a process fails.  It seems that due to a small
bug, sys/kern/kern_prot.c rev 1.66 tightened things up a little bit too
far.

>How-To-Repeat:

while not root:

$ gdb <any program>
...
(gdb) run

>Fix:

Apply this patch.

Index: sys/kern/kern_prot.c
===================================================================
RCS file: /home/ncvs/src/sys/kern/kern_prot.c,v
retrieving revision 1.66
diff -u -r1.66 kern_prot.c
--- sys/kern/kern_prot.c	2000/10/30 20:30:03	1.66
+++ sys/kern/kern_prot.c	2000/11/09 07:06:05
@@ -1084,7 +1084,7 @@
 	/* add a CAP_SYS_PTRACE here? */
 	if (p1->p_cred->pc_ucred->cr_uid != p2->p_cred->p_ruid ||
 	    p1->p_cred->p_ruid != p2->p_cred->p_ruid ||
-	    p1->p_cred->p_svuid == p2->p_cred->p_ruid ||
+	    p1->p_cred->p_svuid != p2->p_cred->p_ruid ||
 	    p2->p_flag & P_SUGID) {
 		if ((error = suser_xxx(0, p1, PRISON_ROOT)))
 			return (error);

>Release-Note:
>Audit-Trail:

From: Brooks Davis <brooks@one-eyed-alien.net>
To: brooks@one-eyed-alien.net
Cc: FreeBSD-gnats-submit@FreeBSD.ORG, rwatson@FreeBSD.ORG
Subject: Re: kern/22711: [PATCH] non-root users can't debug
Date: Wed, 8 Nov 2000 23:23:33 -0800

 On Wed, Nov 08, 2000 at 11:17:17PM -0800, brooks@one-eyed-alien.net wrote:
 > Attempting to run gdb on a process fails.  It seems that due to a small
 > bug, sys/kern/kern_prot.c rev 1.66 tightened things up a little bit too
 > far.
 
 s/proscess/program/
 
 I suspect what I said is true, but it wasn't the problem I encountered.
 
 -- Brooks
 
 -- 
 Any statement of the form "X is the one, true Y" is FALSE.
 
Responsible-Changed-From-To: freebsd-bugs->rwatson 
Responsible-Changed-By: rwatson 
Responsible-Changed-When: Fri Nov 10 15:52:26 PST 2000 
Responsible-Changed-Why:  
That's my bug.  I mis-transcribed sef's change when porting it forwards from -STABLE 

http://www.freebsd.org/cgi/query-pr.cgi?pr=22711 
State-Changed-From-To: open->closed 
State-Changed-By: rwatson 
State-Changed-When: Sun Dec 17 13:31:39 PST 2000 
State-Changed-Why:  
Fix committed on November 10, 2000: 

rwatson     2000/11/10 15:57:48 PST 

Modified files: 
sys/kern             kern_prot.c  
Log: 
o Fix a mis-transcription of sef's -STABLE protection fixes--only root 
could debug processes after the commit that introduced the typo. 
Security is good, but security is not always the same as turning things 
off :-). 

PR:           kern/22711 
Obtained from:        brooks@one-eyed-alien.net 

Revision  Changes    Path 
1.67      +2 -2      src/sys/kern/kern_prot.c 


http://www.freebsd.org/cgi/query-pr.cgi?pr=22711 
>Unformatted:
