All of lore.kernel.org
 help / color / mirror / Atom feed
* 2.6.13: can kill X server but readlink of /proc/<pid>/exe et. al. says EACCES. feature?
@ 2005-09-06 17:53 Frank van Maarseveen
  2005-09-06 17:57 ` viro
  0 siblings, 1 reply; 4+ messages in thread
From: Frank van Maarseveen @ 2005-09-06 17:53 UTC (permalink / raw)
  To: linux-kernel

While I have access to /proc/<pid>, readlink fails with EACCES on

	/proc/<pid>/exe
	/proc/<pid>/cwd
	/proc/<pid>/root

even when I own <pid> though it runs with a different effective/saved/fs
uid such as the X server. This is a bit uncomfortable and doesn't
seem right.

Or is this to make /proc mounting inside a chroot jail safe?

-- 
Frank

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

* Re: 2.6.13: can kill X server but readlink of /proc/<pid>/exe et. al. says EACCES. feature?
  2005-09-06 17:53 2.6.13: can kill X server but readlink of /proc/<pid>/exe et. al. says EACCES. feature? Frank van Maarseveen
@ 2005-09-06 17:57 ` viro
  2005-09-06 18:50   ` Frank van Maarseveen
  0 siblings, 1 reply; 4+ messages in thread
From: viro @ 2005-09-06 17:57 UTC (permalink / raw)
  To: Frank van Maarseveen; +Cc: linux-kernel

On Tue, Sep 06, 2005 at 07:53:49PM +0200, Frank van Maarseveen wrote:
> While I have access to /proc/<pid>, readlink fails with EACCES on
> 
> 	/proc/<pid>/exe
> 	/proc/<pid>/cwd
> 	/proc/<pid>/root
> 
> even when I own <pid> though it runs with a different effective/saved/fs
> uid such as the X server. This is a bit uncomfortable and doesn't
> seem right.
> 
> Or is this to make /proc mounting inside a chroot jail safe?

suid-root task does chdir() to place you shouldn't be able to access.
You do cd /proc/<pid>/cwd and get there anyway.  Bad Things Happen...

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

* Re: 2.6.13: can kill X server but readlink of /proc/<pid>/exe et. al. says EACCES. feature?
  2005-09-06 17:57 ` viro
@ 2005-09-06 18:50   ` Frank van Maarseveen
  2005-09-06 19:02     ` viro
  0 siblings, 1 reply; 4+ messages in thread
From: Frank van Maarseveen @ 2005-09-06 18:50 UTC (permalink / raw)
  To: viro; +Cc: linux-kernel

On Tue, Sep 06, 2005 at 06:57:37PM +0100, viro@ZenIV.linux.org.uk wrote:
> On Tue, Sep 06, 2005 at 07:53:49PM +0200, Frank van Maarseveen wrote:
> > While I have access to /proc/<pid>, readlink fails with EACCES on
> > 
> > 	/proc/<pid>/exe
> > 	/proc/<pid>/cwd
> > 	/proc/<pid>/root
> > 
> > even when I own <pid> though it runs with a different effective/saved/fs
> > uid such as the X server. This is a bit uncomfortable and doesn't
> > seem right.
> > 
> > Or is this to make /proc mounting inside a chroot jail safe?
> 
> suid-root task does chdir() to place you shouldn't be able to access.
> You do cd /proc/<pid>/cwd and get there anyway.  Bad Things Happen...

Ok, but being able to do readlink() does not mean that one can chdir(),
usually.

-- 
Frank

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

* Re: 2.6.13: can kill X server but readlink of /proc/<pid>/exe et. al. says EACCES. feature?
  2005-09-06 18:50   ` Frank van Maarseveen
@ 2005-09-06 19:02     ` viro
  0 siblings, 0 replies; 4+ messages in thread
From: viro @ 2005-09-06 19:02 UTC (permalink / raw)
  To: Frank van Maarseveen; +Cc: linux-kernel

On Tue, Sep 06, 2005 at 08:50:41PM +0200, Frank van Maarseveen wrote:
> On Tue, Sep 06, 2005 at 06:57:37PM +0100, viro@ZenIV.linux.org.uk wrote:
> > On Tue, Sep 06, 2005 at 07:53:49PM +0200, Frank van Maarseveen wrote:
> > > While I have access to /proc/<pid>, readlink fails with EACCES on
> > > 
> > > 	/proc/<pid>/exe
> > > 	/proc/<pid>/cwd
> > > 	/proc/<pid>/root
> > > 
> > > even when I own <pid> though it runs with a different effective/saved/fs
> > > uid such as the X server. This is a bit uncomfortable and doesn't
> > > seem right.
> > > 
> > > Or is this to make /proc mounting inside a chroot jail safe?
> > 
> > suid-root task does chdir() to place you shouldn't be able to access.
> > You do cd /proc/<pid>/cwd and get there anyway.  Bad Things Happen...
> 
> Ok, but being able to do readlink() does not mean that one can chdir(),
> usually.

follow_link on these guys does _not_ traverse parent directories.  So chdir()
checks are more relaxed that way.  Even if we made checks on readlink work
differently, we would still get an information leak - e.g. if task had
created a directory with pathname derived from sensitive data and did chdir
there.  Being able to kill a task != being able to see pieces of its state...


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

end of thread, other threads:[~2005-09-06 19:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-06 17:53 2.6.13: can kill X server but readlink of /proc/<pid>/exe et. al. says EACCES. feature? Frank van Maarseveen
2005-09-06 17:57 ` viro
2005-09-06 18:50   ` Frank van Maarseveen
2005-09-06 19:02     ` viro

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.