xfs
[Top] [All Lists]

[PATCH v3 2/4] xfs: initialize inode security on tmpfile creation

To: xfs@xxxxxxxxxxx
Subject: [PATCH v3 2/4] xfs: initialize inode security on tmpfile creation
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Tue, 15 Apr 2014 12:18:24 -0400
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1397578706-5385-1-git-send-email-bfoster@xxxxxxxxxx>
References: <1397578706-5385-1-git-send-email-bfoster@xxxxxxxxxx>
Initialize security for inodes allocated via the tmpfile interface. This
ensures security is initialized if the inode is subsequently linked back
into the namespace.

Signed-off-by: Brian Foster <bfoster@xxxxxxxxxx>
---
 fs/xfs/xfs_iops.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/fs/xfs/xfs_iops.c b/fs/xfs/xfs_iops.c
index 8fdbc38..2b1d1bd 100644
--- a/fs/xfs/xfs_iops.c
+++ b/fs/xfs/xfs_iops.c
@@ -1063,6 +1063,12 @@ xfs_vn_tmpfile(
 
        inode = VFS_I(ip);
 
+       error = xfs_init_security(inode, dir, &dentry->d_name);
+       if (unlikely(error)) {
+               iput(inode);
+               return -error;
+       }
+
        d_tmpfile(dentry, inode);
 
        return 0;
-- 
1.8.3.1

<Prev in Thread] Current Thread [Next in Thread>