2001-02-07 19:43:23

by Olaf Hering

[permalink] [raw]
Subject: changed proc permissions in 2.4

Hi,

there seems to be a bug in the /proc permissions handling. What I need
is a proc mount in a build chroot. This build chroot should not change
the settings on the build host, therefore its mounted read only. This
was ok with 2.2 kernels.
The 2.4 kernel has appearently only one "handler" for the proc
permissions:

fig:~/lsof # cat /proc/mounts | grep proc
proc /proc proc ro 0 0
/proc/bus/usb /proc/bus/usb usbdevfs rw 0 0

fig:~/lsof # remount rw /proc/

fig:~/lsof # cat /proc/mounts | grep proc
proc /proc proc rw 0 0
/proc/bus/usb /proc/bus/usb usbdevfs rw 0 0

fig:~/lsof # mount -oro -n -tproc none proc

fig:~/lsof # cat /proc/mounts | grep proc
proc /proc proc ro 0 0
/proc/bus/usb /proc/bus/usb usbdevfs rw 0 0
none /root/lsof/proc proc ro 0 0

fig:~/lsof # remount rw /proc/

fig:~/lsof # cat /proc/mounts | grep proc
proc /proc proc rw 0 0
/proc/bus/usb /proc/bus/usb usbdevfs rw 0 0
none /root/lsof/proc proc rw 0 0

fig:~/lsof # umount proc/

fig:~/lsof # mount -oro -n -tproc proc proc

fig:~/lsof # cat /proc/mounts | grep proc
proc /proc proc ro 0 0
/proc/bus/usb /proc/bus/usb usbdevfs rw 0 0
proc /root/lsof/proc proc ro 0 0

fig:~/lsof # cat /proc/version
Linux version 2.4.1-olaf-loop-nohighmem (root@mandarine) (gcc version
2.95.2 19991024 (release)) #1 Tue Feb 6 13:35:53 GMT 2001

this is the 2.2 test:
grapefruit:~ # mkdir blah
grapefruit:~ # cd blah/
grapefruit:~/blah # mkdir proc
grapefruit:~/blah # cat /proc/mounts | grep proc
proc /proc proc rw 0 0
grapefruit:~/blah # mount -oro -n -tproc none proc
grapefruit:~/blah # cat /proc/mounts | grep proc
proc /proc proc rw 0 0
none proc proc ro 0 0

grapefruit:~/blah # cat /proc/version
Linux version 2.2.16 ([email protected]) (gcc version 2.95.3 19991030
(prerelease/franzo/20000625)) #1 Thu Sep 28 08:48:06 GMT 2000


Is this the way it should be?
The real problem is X, it tries to open /proc/bus/pci/*/* rw, that
fails, no devices detected. Its all on ppc, just in case that matters.



Gruss Olaf

--
$ man clone

BUGS
Main feature not yet implemented...


2001-02-07 19:53:43

by Olaf Hering

[permalink] [raw]
Subject: Re: changed proc permissions in 2.4

On Wed, Feb 07, Olaf Hering wrote:

> Is this the way it should be?
> The real problem is X, it tries to open /proc/bus/pci/*/* rw, that
> fails, no devices detected. Its all on ppc, just in case that matters.

oh yeah ...

allen:~/olh # mount -oro -n -tproc none proc
allen:~/olh # grep proc /proc/mounts
proc /proc proc rw 0 0
usbdevfs /proc/bus/usb usbdevfs rw 0 0
none /root/olh/proc proc rw 0 0
allen:~/olh # cat /proc/version
Linux version 2.4.0-4GB ([email protected]) (gcc version 2.95.2
19991024 (release)) #1 Wed Jan 24 15:55:09 GMT 2001


Any ideas where to look for a fix?
ppc is ro and i386 stays rw...



Gruss Olaf

--
$ man clone

BUGS
Main feature not yet implemented...