All of
 help / color / mirror / Atom feed
From: akpm at <>
Subject: [Ocfs2-devel] [patch 02/28] ocfs2: trusted xattr missing CAP_SYS_ADMIN check
Date: Wed, 26 Aug 2015 15:11:24 -0700	[thread overview]
Message-ID: <> (raw)

From: Sanidhya Kashyap <>
Subject: ocfs2: trusted xattr missing CAP_SYS_ADMIN check

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.

Signed-off-by: Sanidhya Kashyap <>
Cc: Mark Fasheh <>
Cc: Joel Becker <>
Cc: Taesoo kim <>
Signed-off-by: Andrew Morton <>

 fs/ocfs2/xattr.c |    3 +++
 1 file changed, 3 insertions(+)

diff -puN fs/ocfs2/xattr.c~ocfs2-trusted-xattr-missing-cap_sys_admin-check fs/ocfs2/xattr.c
--- a/fs/ocfs2/xattr.c~ocfs2-trusted-xattr-missing-cap_sys_admin-check
+++ a/fs/ocfs2/xattr.c
@@ -7334,6 +7334,9 @@ static size_t ocfs2_xattr_trusted_list(s
 	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);

             reply	other threads:[~2015-08-26 22:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 22:11 akpm at [this message]
2015-08-28 23:03 ` [Ocfs2-devel] [patch 02/28] ocfs2: trusted xattr missing CAP_SYS_ADMIN check Mark Fasheh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.