[Top] [All Lists]

Re: [PATCH] xfs: change the immutable in xfs_open_by_handle

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH] xfs: change the immutable in xfs_open_by_handle
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Tue, 10 Sep 2013 17:29:49 -0500
Cc: xfs@xxxxxxxxxxx, Greg Banks <gbanks@xxxxxxx>
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130910212002.GB19103@dastard>
References: <20130910184724.726933044@xxxxxxx> <20130910212002.GB19103@dastard>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 09/10/13 16:20, Dave Chinner wrote:
On Tue, Sep 10, 2013 at 01:47:20PM -0500, Mark Tinguely wrote:
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@xxxxxxx>
Singed-off-by: Mark Tinguely <tinguely@xxxxxxx>
  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)&&

Why the conversion from fmode to permflag? At minimum, this will
probably throw sparse warnings for comparing a FMODE_* flag against
a variable that is not a fmode_t....



Yes, my mistake - a case of posting a Linux 3.0.X based patch.


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