Skip to content

Commit b748fc7

Browse files
jtlaytonidryomov
authored andcommitted
ceph: set sec_context xattr on symlink creation
Symlink inodes should have the security context set in their xattrs on creation. We already set the context on creation, but we don't attach the pagelist. The effect is that symlink inodes don't get an SELinux context set on them at creation, so they end up unlabeled instead of inheriting the proper context. Make it do so. Cc: [email protected] Signed-off-by: Jeff Layton <[email protected]> Reviewed-by: Ilya Dryomov <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent 2c81ef2 commit b748fc7

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs/ceph/dir.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -930,6 +930,10 @@ static int ceph_symlink(struct inode *dir, struct dentry *dentry,
930930
req->r_num_caps = 2;
931931
req->r_dentry_drop = CEPH_CAP_FILE_SHARED | CEPH_CAP_AUTH_EXCL;
932932
req->r_dentry_unless = CEPH_CAP_FILE_EXCL;
933+
if (as_ctx.pagelist) {
934+
req->r_pagelist = as_ctx.pagelist;
935+
as_ctx.pagelist = NULL;
936+
}
933937
err = ceph_mdsc_do_request(mdsc, dir, req);
934938
if (!err && !req->r_reply_info.head->is_dentry)
935939
err = ceph_handle_notrace_create(dir, dentry);

0 commit comments

Comments
 (0)