Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Linux: Kernel

[04/18] fuse: reject O_DIRECT flag also in fuse_create

 

 

Linux kernel RSS feed   Index | Next | Previous | View Threaded


gregkh at suse

Dec 16, 2009, 4:45 PM

Post #1 of 3 (402 views)
Permalink
[04/18] fuse: reject O_DIRECT flag also in fuse_create

2.6.27-stable review patch. If anyone has any objections, please let us know.

------------------
From: Csaba Henk <csaba [at] gluster>

commit 1b7323965a8c6eee9dc4e345a7ae4bff1dc93149 upstream.

The comment in fuse_open about O_DIRECT:

"VFS checks this, but only _after_ ->open()"

also holds for fuse_create, however, the same kind of check was missing there.

As an impact of this bug, open(newfile, O_RDWR|O_CREAT|O_DIRECT) fails, but a
stub newfile will remain if the fuse server handled the implied FUSE_CREATE
request appropriately.

Other impact: in the above situation ima_file_free() will complain to open/free
imbalance if CONFIG_IMA is set.

Signed-off-by: Csaba Henk <csaba [at] gluster>
Signed-off-by: Miklos Szeredi <mszeredi [at] suse>
Cc: Harshavardhana <harsha [at] gluster>
Signed-off-by: Greg Kroah-Hartman <gregkh [at] suse>

---
fs/fuse/dir.c | 3 +++
1 file changed, 3 insertions(+)

--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -401,6 +401,9 @@ static int fuse_create_open(struct inode
if (flags & O_DIRECT)
return -EINVAL;

+ if (flags & O_DIRECT)
+ return -EINVAL;
+
forget_req = fuse_get_req(fc);
if (IS_ERR(forget_req))
return PTR_ERR(forget_req);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


ddaney at caviumnetworks

Dec 16, 2009, 5:36 PM

Post #2 of 3 (383 views)
Permalink
Re: [04/18] fuse: reject O_DIRECT flag also in fuse_create [In reply to]

Greg KH wrote:
> 2.6.27-stable review patch. If anyone has any objections, please let us know.
>
> ------------------
> From: Csaba Henk <csaba [at] gluster>
>
> commit 1b7323965a8c6eee9dc4e345a7ae4bff1dc93149 upstream.
>
> The comment in fuse_open about O_DIRECT:
>
> "VFS checks this, but only _after_ ->open()"
>
> also holds for fuse_create, however, the same kind of check was missing there.
>
> As an impact of this bug, open(newfile, O_RDWR|O_CREAT|O_DIRECT) fails, but a
> stub newfile will remain if the fuse server handled the implied FUSE_CREATE
> request appropriately.
>
> Other impact: in the above situation ima_file_free() will complain to open/free
> imbalance if CONFIG_IMA is set.
>
> Signed-off-by: Csaba Henk <csaba [at] gluster>
> Signed-off-by: Miklos Szeredi <mszeredi [at] suse>
> Cc: Harshavardhana <harsha [at] gluster>
> Signed-off-by: Greg Kroah-Hartman <gregkh [at] suse>
>
> ---
> fs/fuse/dir.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> --- a/fs/fuse/dir.c
> +++ b/fs/fuse/dir.c
> @@ -401,6 +401,9 @@ static int fuse_create_open(struct inode
> if (flags & O_DIRECT)
> return -EINVAL;
>
> + if (flags & O_DIRECT)
> + return -EINVAL;
> +

I must be missing something. The added part seems to be identical to
the lines just above.

Forgive me if I am totally misreading the diff.

David Daney


> forget_req = fuse_get_req(fc);
> if (IS_ERR(forget_req))
> return PTR_ERR(forget_req);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo [at] vger
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/


gregkh at suse

Dec 16, 2009, 8:15 PM

Post #3 of 3 (377 views)
Permalink
Re: [04/18] fuse: reject O_DIRECT flag also in fuse_create [In reply to]

On Wed, Dec 16, 2009 at 05:36:42PM -0800, David Daney wrote:
> Greg KH wrote:
>> 2.6.27-stable review patch. If anyone has any objections, please let us know.
>>
>> ------------------
>> From: Csaba Henk <csaba [at] gluster>
>>
>> commit 1b7323965a8c6eee9dc4e345a7ae4bff1dc93149 upstream.
>>
>> The comment in fuse_open about O_DIRECT:
>>
>> "VFS checks this, but only _after_ ->open()"
>>
>> also holds for fuse_create, however, the same kind of check was missing there.
>>
>> As an impact of this bug, open(newfile, O_RDWR|O_CREAT|O_DIRECT) fails, but a
>> stub newfile will remain if the fuse server handled the implied FUSE_CREATE
>> request appropriately.
>>
>> Other impact: in the above situation ima_file_free() will complain to open/free
>> imbalance if CONFIG_IMA is set.
>>
>> Signed-off-by: Csaba Henk <csaba [at] gluster>
>> Signed-off-by: Miklos Szeredi <mszeredi [at] suse>
>> Cc: Harshavardhana <harsha [at] gluster>
>> Signed-off-by: Greg Kroah-Hartman <gregkh [at] suse>
>>
>> ---
>> fs/fuse/dir.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> --- a/fs/fuse/dir.c
>> +++ b/fs/fuse/dir.c
>> @@ -401,6 +401,9 @@ static int fuse_create_open(struct inode
>> if (flags & O_DIRECT)
>> return -EINVAL;
>> + if (flags & O_DIRECT)
>> + return -EINVAL;
>> +
>
> I must be missing something. The added part seems to be identical to the
> lines just above.
>
> Forgive me if I am totally misreading the diff.

Oops, you are right, this was already included in the last .27 release,
my mistake. I've now deleted it from the .27 queue.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo [at] vger
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

Linux kernel RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.