ocfs2: trusted xattr missing CAP_SYS_ADMIN check
PATCH 2/28 ocfs2: trusted xattr missing CAP_SYS_ADMIN check
From: Sanidhya Kashyap <[email protected]>
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.
---
fs/ocfs2/xattr.c | 3 +++ 1 file changed, 3 insertions(+)
fs/ocfs2/xattr.c renamed from fs/ocfs2/xattr.c~ocfs2-trusted-xattr-missing-cap_sys_admin-check +3 -0
@@ -7334,6 +7334,9 @@ static size_t ocfs2_xattr_trusted_list(sconst 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);
_
PATCH 2/28 ocfs2: trusted xattr missing CAP_SYS_ADMIN check
Quoted 9 lines · Andrew Morton
From: Sanidhya Kashyap <[email protected]>
Subject: ocfs2: trusted xattr missingCAP_SYS_ADMINcheckThe trusted extended attributes are only visible to the process which hvae
CAP_SYS_ADMINcapability but the check is missing in ocfs2xattr_handlertrusted 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.
Quoted 5 lines
Signed-off-by Sanidhya Kashyap <[email protected]>Cc Mark Fasheh <[email protected]>Cc Joel Becker <[email protected]>Cc Taesoo kim <[email protected]>Signed-off-by Andrew Morton <[email protected]>
--
Mark Fasheh