From john@8192.net  Fri Oct 27 23:53:30 2006
Return-Path: <john@8192.net>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 958FC16A403
	for <bug-followup@FreeBSD.org>; Fri, 27 Oct 2006 23:53:30 +0000 (UTC)
	(envelope-from john@8192.net)
Received: from gauss.apisnetworks.com (gauss.apisnetworks.com [66.98.192.43])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 4689E43D49
	for <bug-followup@FreeBSD.org>; Fri, 27 Oct 2006 23:53:30 +0000 (GMT)
	(envelope-from john@8192.net)
Received: from [0.0.0.0] (gauss.apisnetworks.com [66.98.192.43])
	(authenticated bits=0)
	by gauss.apisnetworks.com (8.13.1/8.13.1) with ESMTP id k9RNrRqg021158
	for <bug-followup@FreeBSD.org>; Fri, 27 Oct 2006 19:53:27 -0400
Message-Id: <45429C01.4010601@8192.net>
Date: Fri, 27 Oct 2006 16:53:37 -0700
From: John <john@8192.net>
To: bug-followup@FreeBSD.org
Subject: [PATCH] kern/90063: [procfs] access("/proc/123", F_OK) doesn't work
 on >= 6.x

>Number:         104871
>Category:       kern
>Synopsis:       re: kern/90063: [patch] [procfs] access("/proc/123", F_OK) doesn't work on >= 6.x
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Oct 28 00:00:31 GMT 2006
>Closed-Date:    Sat Oct 28 06:26:33 GMT 2006
>Last-Modified:  Sat Oct 28 06:26:33 GMT 2006
>Originator:     
>Release:        
>Organization:
>Environment:
>Description:
 This is a multi-part message in MIME format.
 --------------000701010706070907050402
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 Greetings,
 
 I've attached a one-line patch for src/sys/fs/pseudofs/pseudofs_vnops.c 
 to fix the issue outlined in kern/90063. The issue stemmed from pseudofs 
 passing an incorrect PID to pfs_visible inside pfs_lookup. When pseudofs 
 would go to look up a process dependent node, it would correctly parse 
 the PID from the path but then fail to pass that PID on to pfs_visible, 
 instead passing a PID which was always visible and thus always returned 
 successfully. This resulted in F_OK always returning successfully as 
 long as the path looked like it contained a valid PID (eg, any positive 
 integer). The reason X_OK failed correctly was due to pfs_access 
 (through pfs_getattr) passing the correct PID to pfs_visible.
 
 The issue likely also affected linprocfs, as it uses the same facilities 
 inside of pseudofs. This patch was tested on 6.2-PRE and should apply 
 cleanly to anything >= 6.1, but if you'd like I can provide a patch for 
 6.0 as well.
 
 Thanks,
 John
 
 
 
 --------------000701010706070907050402
 Content-Type: text/plain;
  name="pseudofs_vnops.c.patch"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: inline;
  filename="pseudofs_vnops.c.patch"
 
 --- pseudofs_vnops.c    Fri Oct 27 00:35:25 2006
 +++ pseudofs_vnops.c    Fri Oct 27 00:06:04 2006
 @@ -408,7 +408,7 @@
   got_pnode:
         if (pn != pd->pn_parent && !pn->pn_parent)
                 pn->pn_parent = pd;
 -       if (!pfs_visible(curthread, pn, pvd->pvd_pid, NULL)) {
 +       if (!pfs_visible(curthread, pn, pid, NULL)) {
                 error = ENOENT;
                 goto failed;
         }
 
 --------------000701010706070907050402--
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: linimon 
State-Changed-When: Sat Oct 28 06:24:02 UTC 2006 
State-Changed-Why:  
Misfiled followup to kern/90063; content migrated. 


Responsible-Changed-From-To: gnats-admin->freebsd-ports-bugs 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sat Oct 28 06:24:02 UTC 2006 
Responsible-Changed-Why:  

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