lkml.org 
[lkml]   [2008]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/4] security: filesystem capabilities bugfix2
Quoting David Howells (dhowells@redhat.com):
> Serge E. Hallyn <serue@us.ibm.com> wrote:
>
> > > With Andrew's patch, capabilities are downgraded regardless of whether we
> > > have CAP_SETPCAP or not. I guess that means that if you're tracing a
> > > binary whose filecaps say that it wants CAP_SETPCAP, then it retains
> > > CAP_SETPCAP.
> >
> > I don't understand where that last sentence comes from. Why would it
> > retain CAP_SETPCAP?
>
> It seems I missed a bit out. It should've read:
>
> I guess that means that if you're tracing a binary that has
> CAP_SETPCAP already, and whose filecaps say that it wants CAP_SETPCAP,
> then it retains CAP_SETPCAP.
>
> If the debugger has CAP_SYS_PTRACE, then it can attach to a binary that has
> CAP_SETPCAP according to cap_ptrace(), even if the debugger doesn't.

Ah. Yes. I think that's the desirable behavior in all proposals.

> > > I wonder if the tracing task should be examined here, and any capability the
> > > tracer isn't permitted should be denied the process doing the exec.
> >
> > That sounds reasonable on its own, but it opens up a dangerous ability
> > for the partially-privileged tracer to manipulate the capability set for
> > the traced task.
>
> Does it, though? It would only reduce the capabilities of the inferior
> process; it wouldn't allow the inferior process or the debugger to get
> additional capabilities, apart from what's available under CAP_SETPCAP.

And the uids won't change unless capable(CAP_SETUID)... so I think
you're right, it does sound safe.

thanks,
-serge


\
 
 \ /
  Last update: 2008-06-30 22:03    [W:0.099 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site