From ross@rocksoft.com  Sat Jan 15 20:14:07 2000
Return-Path: <ross@rocksoft.com>
Received: from ash25.adelaide.on.net (ash25.internode.on.net [203.16.214.248])
	by hub.freebsd.org (Postfix) with ESMTP id 0BEF614CC7
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 15 Jan 2000 20:14:06 -0800 (PST)
	(envelope-from ross@rocksoft.com)
Received: from [203.16.208.220] by internode.on.net (PMDF V5.2-32 #35726)
 with ESMTP id <01JKRY6FL8UY007JO7@internode.on.net> for
 FreeBSD-gnats-submit@freebsd.org; Sun, 16 Jan 2000 14:45:00 +1030
Message-Id: <v04220808b4a6e1bcaffa@[203.16.208.220]>
Date: Sun, 16 Jan 2000 14:43:54 +1030
From: "Ross N. Williams" <ross@rocksoft.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc: newton@internode.com.au
Subject: /proc contains regular files of infinite length.

>Number:         16140
>Category:       kern
>Synopsis:       /proc contains regular files of infinite length.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 15 20:20:01 PST 2000
>Closed-Date:    Thu Jun 1 15:38:24 PDT 2000
>Last-Modified:  Thu Jun 01 15:38:54 PDT 2000
>Originator:     Ross Williams
>Release:        FreeBSD 3.3-RELEASE i386
>Organization:
Rocksoft Pty Ltd
>Environment:
 
    FreeBSD 3.3-RELEASE i386
 
>Description:
 
 In Unix, regular files are supposed to be regular. If you write a
 program that (say) backs up the file system, it's supposed to be
 able to tell which files are unreadable by their type
 directories/devices/pipes/etc rather than their location.
 
 My product Veracity http://www.veracity.com/ pays attention to file
 type and is careful not to attempt to read anything but directory
 files and regular files.
 
 However, on FreeBSD, there are regular files of infinite length.
 There are lots of them lurking in /proc. For example /proc/1/fpregs
 which apparently provides a snapshot of the floating point registers.
 
 You might say "so what? Just ignore them", but such files break the
 promise of the properties of regular files, forcing tools such as
 Veracity to block out files by NAME, and this doesn't always work.
 For example, a random user could softlink an entry in one of their
 directories to /proc/1/fpregs and if Veracity was being told to follow
 symlinks (as it can be told, but does not do by default) then it
 would get stuck. It's far far better to simply provide a guarantee
 that all regular files will be readable and of finite length.
 
 So I propose that the FreeBSD developers change these unusual
 files to a type that is not regular.
 
>How-To-Repeat:
 
  Do it again.
 
>Fix:
 
    I am configuring my product http://www.veracity.com/ to ignore /proc
 
 Ross.
 
 Dr Ross N. Williams (ross@rocksoft.com), +61 8 8232-6262 (fax-6264).
 Director, Rocksoft Pty Ltd, Adelaide, Australia: http://www.rocksoft.com/ 
 Protect your files with Veracity data integrity: http://www.veracity.com/
 
>Release-Note:
>Audit-Trail:

From: Poul-Henning Kamp <phk@critter.freebsd.dk>
To: "Ross N. Williams" <ross@rocksoft.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org, newton@internode.com.au
Subject: Re: pending/16140: /proc contains regular files of infinite length. 
Date: Sun, 16 Jan 2000 09:30:30 +0100

 I belive we have reduced the size of files in /proc to be zero length
 in -current.
 
 --
 Poul-Henning Kamp             FreeBSD coreteam member
 phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
 FreeBSD -- It will take a long time before progress goes too far!
 

From: "Ross N. Williams" <ross@rocksoft.com>
To: Poul-Henning Kamp <phk@critter.freebsd.dk>
Cc: FreeBSD-gnats-submit@FreeBSD.org, newton@internode.com.au
Subject: Re: pending/16140: /proc contains regular files of infinite length.
Date: Sun, 16 Jan 2000 22:00:05 +1030

 At 9:30 AM +0100 16/1/2000, Poul-Henning Kamp wrote:
 >I belive we have reduced the size of files in /proc to be zero length
 >in -current.
 
 That's good, but how are they useful then?
 
 What's stopping you from eliminating them?
 
 /proc/fpregs seems to provide the floating point registers
 over and over when you read it. If it's zero length, how can
 the file be useful at all? From my unknowledgeable point of
 view, it just looks as if they should be left as they are,
 but reclassified as devices.
 
 
 Ross.
 
 Dr Ross N. Williams (ross@rocksoft.com), +61 8 8232-6262 (fax-6264).
 Director, Rocksoft Pty Ltd, Adelaide, Australia: http://www.rocksoft.com/ 
 Protect your files with Veracity data integrity: http://www.veracity.com/
 

From: Poul-Henning Kamp <phk@critter.freebsd.dk>
To: "Ross N. Williams" <ross@rocksoft.com>
Cc: FreeBSD-gnats-submit@FreeBSD.org, newton@internode.com.au
Subject: Re: pending/16140: /proc contains regular files of infinite length. 
Date: Sun, 16 Jan 2000 13:50:12 +0100

 In message <v04220801b4a75ba05365@[203.16.208.220]>, "Ross N. Williams" writes:
 >At 9:30 AM +0100 16/1/2000, Poul-Henning Kamp wrote:
 >>I belive we have reduced the size of files in /proc to be zero length
 >>in -current.
 >
 >That's good, but how are they useful then?
 
 They still have their contents, but stat(2) will return zero if we can't
 predict the size without rendering the entire file.
 
 This at least kept dump(8) from complaining about them changing size.
 
 >What's stopping you from eliminating them?
 
 we need them :-)
 
 >/proc/fpregs seems to provide the floating point registers
 >over and over when you read it.
 
 That sounds like a geniune bug to me.
 
 --
 Poul-Henning Kamp             FreeBSD coreteam member
 phk@FreeBSD.ORG               "Real hackers run -current on their laptop."
 FreeBSD -- It will take a long time before progress goes too far!
 
Responsible-Changed-From-To: gnats-admin->freebsd-bugs 
Responsible-Changed-By: asmodai 
Responsible-Changed-When: Fri Feb 4 00:47:42 PST 2000 
Responsible-Changed-Why:  
Misfiled PR. 
State-Changed-From-To: open->closed 
State-Changed-By: phk 
State-Changed-When: Thu Jun 1 15:38:24 PDT 2000 
State-Changed-Why:  
I think we're done with this one. 

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