lkml.org 
[lkml]   [2008]   [Sep]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] capability: WARN when invalid capability is requested rather than BUG/panic
From
Date
On Tue, 2008-09-30 at 11:28 -0500, Serge E. Hallyn wrote:
> Quoting Eric Paris (eparis@redhat.com):

> > > Perhaps we should have CAP_TO_INDEX mask itself?
> > >
> > > #define CAP_TO_INDEX(x) (((x) >> 5) & _KERNEL_CAPABILITY_U32S)
> >
> > Well, you save a branch and won't get the pagefault so it does 'fix' the
> > pagefault/panic from cap code. It doesn't tell us when others screw up
> > and SELinux is still possibly going to BUG(). We are also going to
> > actually be returning a permission decision not on what was requested
> > but on something wholely different.
>
> So exactly what was requested?

A capability that they cannot possibly have since it doesn't exist :)

> > I like mine better, but I'm ok with yours and can just do my changes in
> > SELinux if this is how cap wants to handle it. I don't really like the
>
> Heh I don't like either one, just thought this would reduce the overhead
> a bit :)

No argument from me that patching up for buggy drivers sucks. Yours
would be less overhead, and it would return the cap system back to
pre-2.6.25 operation (garbage in garbage out but no panic). Since we
already have the branch in SELinux its no 'extra' overhead to EPERM
there instead of here (garbage in EPERM out).

-Eric



\
 
 \ /
  Last update: 2008-09-30 19:27    [W:0.066 / U:0.776 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site