linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* /bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied
@ 2004-08-16 13:37 Olaf Hering
  2004-08-16 22:19 ` Olaf Hering
  2004-08-16 22:39 ` Olaf Hering
  0 siblings, 2 replies; 6+ messages in thread
From: Olaf Hering @ 2004-08-16 13:37 UTC (permalink / raw)
  To: linux-kernel


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied
  2004-08-16 13:37 /bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied Olaf Hering
@ 2004-08-16 22:19 ` Olaf Hering
  2004-08-16 22:39 ` Olaf Hering
  1 sibling, 0 replies; 6+ messages in thread
From: Olaf Hering @ 2004-08-16 22:19 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton

 On Mon, Aug 16, Olaf Hering wrote:

> 
> 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

bprm.interp_flags contains garbage like 0xc0000001,
that triggers task->mm->dumpable =0;

please apply.

Signed-off-by: Olaf Hering <olh@suse.de>

diff -p -purN linux-2.6.8.1.omfg/fs/compat.c linux-2.6.8.1/fs/compat.c
--- linux-2.6.8.1.omfg/fs/compat.c	2004-08-14 12:55:31.000000000 +0200
+++ linux-2.6.8.1/fs/compat.c	2004-08-17 00:14:56.000000000 +0200
@@ -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;

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

sUse lINUX ag, nÜRNBERG

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied
  2004-08-16 13:37 /bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied Olaf Hering
  2004-08-16 22:19 ` Olaf Hering
@ 2004-08-16 22:39 ` Olaf Hering
  2004-08-16 23:34   ` Andreas Schwab
  1 sibling, 1 reply; 6+ messages in thread
From: Olaf Hering @ 2004-08-16 22:39 UTC (permalink / raw)
  To: linux-kernel, Andrew Morton

 On Mon, Aug 16, Olaf Hering wrote:

> 
> 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

A better one, clear both new fields, just in case.


diff -p -purN linux-2.6.8.1.omfg/fs/compat.c linux-2.6.8.1/fs/compat.c
--- linux-2.6.8.1.omfg/fs/compat.c	2004-08-14 12:55:31.000000000 +0200
+++ linux-2.6.8.1/fs/compat.c	2004-08-17 00:33:36.000000000 +0200
@@ -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;

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

sUse lINUX ag, nÜRNBERG

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied
  2004-08-16 22:39 ` Olaf Hering
@ 2004-08-16 23:34   ` Andreas Schwab
  2004-08-17  5:23     ` Olaf Hering
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2004-08-16 23:34 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linux-kernel, Andrew Morton

Olaf Hering <olh@suse.de> writes:

>  On Mon, Aug 16, Olaf Hering wrote:
>
>> 
>> 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
>
> A better one, clear both new fields, just in case.

memset?

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
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."

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied
  2004-08-16 23:34   ` Andreas Schwab
@ 2004-08-17  5:23     ` Olaf Hering
  2004-08-17  8:50       ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Olaf Hering @ 2004-08-17  5:23 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linux-kernel, Andrew Morton

 On Tue, Aug 17, Andreas Schwab wrote:

> Olaf Hering <olh@suse.de> writes:
> 
> >  On Mon, Aug 16, Olaf Hering wrote:
> >
> >> 
> >> 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
> >
> > A better one, clear both new fields, just in case.
> 
> memset?

perhaps too expensive, no idea.

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

sUse lINUX ag, nÜRNBERG

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: /bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied
  2004-08-17  5:23     ` Olaf Hering
@ 2004-08-17  8:50       ` Andreas Schwab
  0 siblings, 0 replies; 6+ messages in thread
From: Andreas Schwab @ 2004-08-17  8:50 UTC (permalink / raw)
  To: Olaf Hering; +Cc: linux-kernel, Andrew Morton

Olaf Hering <olh@suse.de> writes:

>> > 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.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
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."

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-17  8:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-16 13:37 /bin/ls: cannot read symbolic link /proc/$$/exe: Permission denied Olaf Hering
2004-08-16 22:19 ` Olaf Hering
2004-08-16 22:39 ` Olaf Hering
2004-08-16 23:34   ` Andreas Schwab
2004-08-17  5:23     ` Olaf Hering
2004-08-17  8:50       ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).