lkml.org 
[lkml]   [2011]   [May]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/4] Cache xattr security drop check for write
From
Date
On Fri, 27 May 2011 15:54:02 PDT, Andi Kleen said:

> @@ -2578,5 +2580,10 @@ int __init get_filesystem_list(char *buf);
> #define OPEN_FMODE(flag) ((__force fmode_t)(((flag + 1) & O_ACCMODE) | \
> (flag & __FMODE_NONOTIFY)))
>
> +static inline int is_sgid(mode_t mode)
> +{
> + return (mode & S_ISUID) || ((mode & S_ISGID) && (mode & S_IXGRP));
> +}
> +

There has *got* to be a better name for this function.

And having said that, I'm not convinced it's the *right* check - on an SELinux
system, pretty much *all* the files have a security xattr attached to them, and
very few are actually setuid/setgid. So 98% of the time, or more, this will DTWT.

[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2011-05-29 15:55    [W:0.209 / U:0.244 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site