From owner-freebsd-bugs Sun Sep 16 9: 0:15 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 09A0E37B409 for ; Sun, 16 Sep 2001 09:00:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f8GG01r58081; Sun, 16 Sep 2001 09:00:01 -0700 (PDT) (envelope-from gnats) Received: from r4k.net (r4k.net [194.109.74.241]) by hub.freebsd.org (Postfix) with ESMTP id D173D37B408 for ; Sun, 16 Sep 2001 08:54:43 -0700 (PDT) Received: (from _@localhost) by r4k.net (8.11.3/8.11.1) id f8GFsgD99665; Sun, 16 Sep 2001 17:54:42 +0200 (CEST) (envelope-from _) Message-Id: <200109161554.f8GFsgD99665@r4k.net> Date: Sun, 16 Sep 2001 17:54:42 +0200 (CEST) From: _@r4k.net Reply-To: _@r4k.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/30608: [PATCH] kern.ps_showallproc=0 doesn't limit queries for a single pid Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30608 >Category: kern >Synopsis: kern.ps_showallproc=0 doesn't limit queries for a single pid >Confidential: no >Severity: non-critical >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Sep 16 09:00:00 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Stephanie Wehner >Release: FreeBSD 4.4-STABLE i386 >Organization: private >Environment: 4.4-STABLE as of 16/09/2001: /sys/kern/kern_proc.c v1.63.2.8 >Description: Even though kern.ps_showallproc is set to 0, users can still see others users processes if querying information about a single pid. (KERN_PROC_PID) This way they could still obtain information about all processes by querying pid for pid. This is fixed in current, but not in 4.4-STABLE. >How-To-Repeat: Set sysctl -w kern.ps_showallproc=0 and then do a ps 1 from a user account for example. >Fix: This is a patch which resolves this problem using the 4.4 checking function (p_trespass): *** kern_proc.c.orig Sun Sep 16 18:27:38 2001 --- kern_proc.c Sun Sep 16 19:10:38 2001 *************** *** 451,456 **** --- 451,458 ---- p = pfind((pid_t)name[0]); if (!p) return (0); + if((!ps_showallprocs) && p_trespass(curproc, p)) + return(0); if (!PRISON_CHECK(curproc, p)) return (0); error = sysctl_out_proc(p, req, 0); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message