public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: change the immutable in xfs_open_by_handle
@ 2013-09-10 18:47 Mark Tinguely
  2013-09-10 21:20 ` Dave Chinner
  2013-09-11 13:55 ` Christoph Hellwig
  0 siblings, 2 replies; 6+ messages in thread
From: Mark Tinguely @ 2013-09-10 18:47 UTC (permalink / raw)
  To: xfs; +Cc: Greg Banks

[-- Attachment #1: xfs-change-immutable-in-xfs_open_by_handle.patch --]
[-- Type: text/plain, Size: 991 bytes --]

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.

Signed-off-by: Greg Banks <gbanks@sgi.com>
Singed-off-by: Mark Tinguely <tinguely@sgi.com>
---
 fs/xfs/xfs_ioctl.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: b/fs/xfs/xfs_ioctl.c
===================================================================
--- a/fs/xfs/xfs_ioctl.c
+++ 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 ((permflag & FMODE_WRITE) &&
+	    IS_IMMUTABLE(inode) &&
+	    !capable(CAP_LINUX_IMMUTABLE)) {
 		error = -XFS_ERROR(EACCES);
 		goto out_dput;
 	}


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-11 15:50 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-10 18:47 [PATCH] xfs: change the immutable in xfs_open_by_handle Mark Tinguely
2013-09-10 21:20 ` Dave Chinner
2013-09-10 22:29   ` Mark Tinguely
2013-09-11 13:55 ` Christoph Hellwig
2013-09-11 14:22   ` Mark Tinguely
2013-09-11 15:50     ` Matthias Schniedermeyer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox