Re: ps under FreeBSD

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

 



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

[Index of Archives]     [Linux Security]     [Netfilter]     [PHP]     [Yosemite News]     [Linux Kernel]

  Powered by Linux