Subject: non root processes cannot list /proc anymore
To: NetBSD current <current-users@NetBSD.org>
From: Nicolas Joly <njoly@pasteur.fr>
List: current-users
Date: 12/03/2006 02:00:12
Hi,

I just noticed that non root process cannot list `/proc' anymore.

njoly@cixy [~]> uname -a
NetBSD cixy.dial.pasteur.fr 4.99.5 NetBSD 4.99.5 (CIXY) #30: Sat Dec  2 23:56:16 CET 2006  njoly@cixy.dial.pasteur.fr:/local/src/NetBSD/obj/i386/sys/arch/i386/compile/CIXY i386

njoly@cixy [~]> mount -v | grep proc        
njoly@cixy [~]> sudo mount_procfs /proc /proc 
njoly@cixy [~]> mount -v | grep proc        
procfs on /proc type procfs (local, fsid: 0x1b01/0x1ae1b, reads: sync 0 async 0, writes: sync 0 async 0)
njoly@cixy [~]> ls /proc 
ls: proc: Operation not permitted
njoly@cixy [~]> sudo ls /proc 
0       110     1266    3       4       659     726     8       921     self
1       1114    13      356     401     667     727     829     949
10      1170    14      361     424     694     734     84      96
1008    12      1616    363     5       695     755     860     981
1082    1209    162     365     52      7       763     861     991
11      1212    2       367     6       702     79      9       curproc

It seems that only file listing is disabled, because access is granted.

njoly@cixy [~]> cd /proc
njoly@cixy [/proc]> ls
ls: .: Operation not permitted
njoly@cixy [/proc]> ls -ld .
dr-xr-xr-x  1 root  wheel  512 Dec  3 01:54 .

It tracked this behaviour change to kauth(9) use for procfs, on
2006/11/28. Reverting sys/miscfs/procfs/procfs_vnops.c to 1.139 (and
restoring needed process_checkioperm() function) solve the problem.

Thanks in advance,
Regards.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.