lkml.org 
[lkml]   [2006]   [Jan]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/4] move capable() to capability.h
Tim Schmielau <tim@physik3.uni-rostock.de> wrote:
>
> On Sat, 7 Jan 2006, Randy.Dunlap wrote:
>
> ...
> > +#ifdef CONFIG_SECURITY
> > +/* code is in security.c */
> > +extern int capable(int cap);
> > +#else
> > +static inline int capable(int cap)
> > +{
> > + if (cap_raised(current->cap_effective, cap)) {
> > + current->flags |= PF_SUPERPRIV;
> > + return 1;
> > + }
> > + return 0;
> > +}
> > +#endif
>
> I wonder how this can actually work. For dereferencing current, it is not
> enough to include <asm/current.h>. The actual layout of struct task_struct
> needs to be known to the compiler, which is given in <linux/sched.h>.
>
> Maybe you were just lucky with your .config and every file using capable()
> just by chance also included <linux/sched.h>?
>
> (Chances are not bad since currently about every other .c file includes
> sched.h. However, I have patches pending to reduce this number to ~500..1000)
>
> Uninlining capable() might indeed help us here.
>

I mangled Randy's patch so it applies after uninline-capable.patch, so all
is OK.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-08 20:05    [W:0.109 / U:0.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site