[25518] in bugtraq

home help back first fref pref prev next nref lref last post

Re: ps under FreeBSD

daemon@ATHENA.MIT.EDU (Guillaume PELAT)
Mon May 20 20:22:19 2002

Content-Type: text/plain;
  charset="iso-8859-1"
From: Guillaume PELAT <guillaume.pelat@intexxia.com>
Reply-To: guillaume.pelat@intexxia.com
To: bugtraq@securityfocus.com
Date: Sun, 19 May 2002 11:51:08 +0200
In-Reply-To: <20020518204038.A41695@fremen.dhs.org>
MIME-Version: 1.0
Message-Id: <200205191151.08626.guillaume.pelat@intexxia.com>
Content-Transfer-Encoding: 8bit

On Saturday 18 May 2002 20:40, Jakub Filonik wrote:
> Hi,
> I was playing with ps on FreeBSD with kern.ps_showallprocs=0 and I was
> surprised when I have seen that I may see info about running process, if I
> know it's ID
After some investigation, the problem seems to be in sysctl_kern_proc
function in /sys/kern/kern_proc.c

The following patch seems to fix the problem(for freebsd 4.5):

diff -dru sys/kern/kern_proc.c sys.new/kern/kern_proc.c
--- sys/kern/kern_proc.c	Tue May  1 15:39:06 2001
+++ sys.new/kern/kern_proc.c	Sat May 18 15:27:57 2002
@@ -453,6 +453,8 @@
 			return (0);
 		if (!PRISON_CHECK(curproc, p))
 			return (0);
+		if ((!ps_showallprocs) && p_trespass(curproc, p))
+			return (0);
 		error = sysctl_out_proc(p, req, 0);
 		return (error);
 	}

--
Guillaume Pelat

home help back first fref pref prev next nref lref last post