/bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied
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.
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 10 lines · Olaf Hering
For some reasons ls -l
/proc/$$/exedoesnt 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 inproc_pid_readlink()triggers an-EACCES:current->fsuid != inode->i_uid
proc_pid_readlink(755)error -13 ntptrace(11408) fsuid 100i_uid0 0sys_readlink(281)ntptrace(11408) error -13 readlink
bprm.interp_flags contains garbage like 0xc0000001, that triggers task->mm->dumpable =0;
please apply.
fs/compat.c +1 -0
@@ -1390,6 +1390,7 @@ int compat_do_execve(char * filename, bprm.sh_bang =0 ; bprm.loader =0 ; bprm.exec =0 ; + bprm.interp_flags =0 ; bprm.security =NULL ; bprm.mm =mm_alloc (); retval = -ENOMEM ;
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 10 lines · Olaf Hering
For some reasons ls -l
/proc/$$/exedoesnt 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 inproc_pid_readlink()triggers an-EACCES:current->fsuid != inode->i_uid
proc_pid_readlink(755)error -13 ntptrace(11408) fsuid 100i_uid0 0sys_readlink(281)ntptrace(11408) error -13 readlink
A better one, clear both new fields, just in case.
fs/compat.c +2 -0
@@ -1390,6 +1390,8 @@ int compat_do_execve(char * filename, bprm.sh_bang =0 ; bprm.loader =0 ; bprm.exec =0 ; + bprm.interp_flags =0 ; + bprm.interp_data =0 ; bprm.security =NULL ; bprm.mm =mm_alloc (); retval = -ENOMEM ;
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 8 lines · Olaf Hering
Quoted 6 lines · Olaf Hering
For some reasons ls -l
/proc/$$/exedoesnt 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 inproc_pid_readlink()triggers an-EACCES:
Quoted 6 lines
Quoted 4 lines
current->fsuid != inode->i_uid
proc_pid_readlink(755)error -13 ntptrace(11408) fsuid 100i_uid0 0sys_readlink(281)ntptrace(11408) error -13 readlinkA better one, clear both new fields, just in case.
memset?
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 10 lines · Andreas Schwab
Quoted 8 lines · Olaf Hering
Quoted 6 lines · Olaf Hering
For some reasons ls -l
/proc/$$/exedoesnt 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 inproc_pid_readlink()triggers an-EACCES:
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
current->fsuid != inode->i_uid
proc_pid_readlink(755)error -13 ntptrace(11408) fsuid 100i_uid0 0sys_readlink(281)ntptrace(11408) error -13 readlinkA better one, clear both new fields, just in case.
memset?
perhaps too expensive, no idea.
Signature · 3 lines
USB is for mice, FireWire is for men! sUse lINUX ag, nÜRNBERG
Quoted 5 lines · Olaf Hering
Quoted 3 lines
Quoted 1 line
A better one, clear both new fields, just in case.
memset?
perhaps too expensive, no idea.
I don't think that this part of compat_do_execve is exactly time critical.
Andreas.
Signature · 4 lines
Andreas Schwab, SuSE Labs, [email protected] SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."