From: Sanidhya Kashyap <sanidhya.gatech@gmail.com>
To: mfasheh@suse.com, jlbec@evilplan.org, ocfs2-devel@oss.oracle.com,
linux-kernel@vger.kernel.org
Cc: taesoo@gatech.edu, changwoo@gatech.edu, sanidhya@gatech.edu,
blee@gatech.edu, csong84@gatech.edu,
Sanidhya Kashyap <sanidhya.gatech@gmail.com>
Subject: [PATCH] ocfs2: trusted xattr missing CAP_SYS_ADMIN check
Date: Tue, 24 Mar 2015 11:46:32 -0400 [thread overview]
Message-ID: <1427211992-9803-1-git-send-email-sanidhya.gatech@gmail.com> (raw)
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 <sanidhya.gatech@gmail.com>
---
fs/ocfs2/xattr.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c
index 85b190d..71a6551 100644
--- 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);
--
2.1.0
next reply other threads:[~2015-03-24 15:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-24 15:46 Sanidhya Kashyap [this message]
2015-03-24 21:06 ` [Ocfs2-devel] " Andrew Morton
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1427211992-9803-1-git-send-email-sanidhya.gatech@gmail.com \
--to=sanidhya.gatech@gmail.com \
--cc=blee@gatech.edu \
--cc=changwoo@gatech.edu \
--cc=csong84@gatech.edu \
--cc=jlbec@evilplan.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mfasheh@suse.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=sanidhya@gatech.edu \
--cc=taesoo@gatech.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome