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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux