lkml.org 
[lkml]   [2015]   [Mar]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Ocfs2-devel] [PATCH] ocfs2: trusted xattr missing CAP_SYS_ADMIN check
On Tue, 24 Mar 2015 11:46:32 -0400 Sanidhya Kashyap <sanidhya.gatech@gmail.com> wrote:

> The trusted extended attributes are only visible to the process which hvae
> CAP_SYS_ADMIN capability but the check is missing in ocfs2 xattr_handler
> trusted list. The check is important because this will be used for implementing
> mechanisms in the userspace for which other ordinary processes should not
> have access to.
>
> ...
>
> --- a/fs/ocfs2/xattr.c
> +++ b/fs/ocfs2/xattr.c
> @@ -7326,6 +7326,9 @@ static size_t ocfs2_xattr_trusted_list(struct dentry *dentry, char *list,
> const size_t prefix_len = XATTR_TRUSTED_PREFIX_LEN;
> const size_t total_len = prefix_len + name_len + 1;
>
> + if (!capable(CAP_SYS_ADMIN))
> + return 0;
> +
> if (list && total_len <= list_size) {
> memcpy(list, XATTR_TRUSTED_PREFIX, prefix_len);
> memcpy(list + prefix_len, name, name_len);

Ouch. Won't this break existing userspace?


\
 
 \ /
  Last update: 2015-03-24 22:41    [W:0.033 / U:0.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site