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: stable@vger.kernel.org Signed-off-by: Jeff Layton <jlayton@kernel.org> Reviewed-by: Ilya Dryomov <idryomov@gmail.com> Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
1 parent 2c81ef2 commit b748fc7

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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)