lkml.org 
[lkml]   [2008]   [Oct]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] capability: WARN when invalid capability is requested rather than BUG/panic
Date
Eric Paris <eparis@redhat.com> wrote:

> Do we have any concern of a module being compiled against a new kernel
> say with cap number 35 defined and then loaded into a kernel with only
> 34 capabilities? Do we care about that forward compatibility? If we
> care BUG is scary. EPERM would be the right thing since clearly on this
> kernel the process can't possibly have cap #35.
>
> We really have 4 options (in the order I like them).
>
> 1) do nothing (garbage in garbage out, sometimes panic sometimes not)
> 2) mask CAP_TO_INDEX (garbage in garbage out, no panic)
> 3) BUG_ON(!cap_valid(flag)) (garbage in BUG out, no panic)
> 4) WARN_ON/EPERM (garbage in EPERM out, no panic)

5) Use a macro or inline function to test for $cap <= $max_cap, eliminating
the test in the final code.



\
 
 \ /
  Last update: 2008-10-01 21:29    [W:0.026 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site