Skip to contentSkip to conversation

xfs: v2 change the immutable in xfs_open_by_handle

PATCH New Mark Tinguely 1 participant 1 message Sep 10, 2013 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: v2 change the immutable in xfs_open_by_handle

This patch allows clients like DMF to modify an immutable file without changing the immutable capability on the file, which would expose the file to change.

This patch is restricted to holders of the CAP_LINUX_IMMUTABLE, so no addition security risk has been introduced.

---
v1->v2 fix the FMODE_WRITE test.

 fs/xfs/xfs_ioctl.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
fs/xfs/xfs_ioctl.c +3 -1
Index: b/fs/xfs/xfs_ioctl.c
===================================================================
@@ -237,7 +237,9 @@ xfs_open_by_handle(
 		goto out_dput;
 	}
 
-	if ((fmode & FMODE_WRITE) && IS_IMMUTABLE(inode)) {
+	if ((fmode & FMODE_WRITE) &&
+	    IS_IMMUTABLE(inode) &&
+	    !capable(CAP_LINUX_IMMUTABLE)) {
 		error = -XFS_ERROR(EACCES);
 		goto out_dput;
 	}

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs