From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from relay.sgi.com (relay1.corp.sgi.com [137.38.102.111]) by oss.sgi.com (Postfix) with ESMTP id C08407F54 for ; Tue, 10 Sep 2013 13:49:44 -0500 (CDT) Message-Id: <20130910184724.726933044@sgi.com> Date: Tue, 10 Sep 2013 13:47:20 -0500 From: Mark Tinguely Subject: [PATCH] xfs: change the immutable in xfs_open_by_handle Content-Disposition: inline; filename=xfs-change-immutable-in-xfs_open_by_handle.patch List-Id: XFS Filesystem from SGI List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: xfs-bounces@oss.sgi.com Sender: xfs-bounces@oss.sgi.com To: xfs@oss.sgi.com Cc: Greg Banks 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 Singed-off-by: Mark Tinguely --- 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