/bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied

From: Olaf Hering
Date: Mon Aug 16 2004 - 08:41:48 EST



For some reasons ls -l /proc/$$/exe doesnt work all time for me,
with 2.6.8.1 on ppc64. Sometimes it does, sometimes not. No pattern.
A few printks show that this check in proc_pid_readlink() triggers
an -EACCES:

current->fsuid != inode->i_uid

proc_pid_readlink(755) error -13 ntptrace(11408) fsuid 100 i_uid 0 0
sys_readlink(281) ntptrace(11408) error -13 readlink
proc_pid_readlink(755) error -13 ls(11509) fsuid 91 i_uid 0 0
sys_readlink(281) ls(11509) error -13 readlink
proc_pid_readlink(755) error -13 ls(11559) fsuid 91 i_uid 0 0
sys_readlink(281) ls(11559) error -13 readlink
proc_pid_readlink(755) error -13 ls(11621) fsuid 91 i_uid 0 0
sys_readlink(281) ls(11621) error -13 readlink

any ideas what is supposed to happen here? Who should set the
inode->i_uid? ssh to the smp box runs the login scripts, they try to
figure out what shell is running via ls -l /proc/$$/exe
This works ok with our 2.6.5 kernel at least.


--
USB is for mice, FireWire is for men!

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