Re: [PATCH] Enhancement of /proc/partitions output (2.5.1-pre5)

Bill Davidsen (davidsen@tmr.com)
Mon, 3 Dec 2001 11:30:44 -0500 (EST)


On Sat, 1 Dec 2001 Andries.Brouwer@cwi.nl wrote:

> The present /proc/partitions has minimal content.
> Its only function is to report to user space which block devices
> are known to the kernel. User space is unable to figure that out
> on its own without an unreasonable amount of probing.
>
> But once you know what devices exist, it is very easy for user space
> to report all desired properties of these devices.
> Do you want starting sector and size of /dev/hde4?
>
> # hdparm -g /dev/hde4
>
> /dev/hde4:
> geometry = 70780/16/63, sectors = 1670760, start = 69673905

Really? Do you run hdparm setuid root or allow read access of hde? In any
case, allowing easy access from user space via hdparm trickes me as a
major security issue. The geometry is in /proc/ide/hd?/geometry, but the
other info is not readily available to other than root user in most
systems. I think his intention was to make it more generally available. I
don't see any reason to require root to see this information, and I think
reducing the need for root is a good thing for security.

It would be highly desirable to define new proc data as subject to
addition of more information per line at any time, and as long as the
fields are added at the end of the line a parser can easily be written not
to break. As you note, changing existing information presents other
problems and will break things, since /proc/partitions was not defines as
extensible.

I personally would have no problem adding this to 2.5, lots of things will
change, but I agree that a change to 2.4 is not practical as a retrofit.

-- 
bill davidsen <davidsen@tmr.com>
  CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/