Skip to content

Commit

Permalink
fuse: check create mode in atomic open
Browse files Browse the repository at this point in the history
Verify that the VFS is passing us a complete create mode with the S_IFREG to
atomic open.

Reported-by: Steve <steveamigauk@yahoo.co.uk>
Reported-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Richard W.M. Jones <rjones@redhat.com>
  • Loading branch information
Miklos Szeredi committed Aug 15, 2012
1 parent 38227f7 commit af109bc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fs/fuse/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,9 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry,
struct fuse_entry_out outentry;
struct fuse_file *ff;

/* Userspace expects S_IFREG in create mode */
BUG_ON((mode & S_IFMT) != S_IFREG);

forget = fuse_alloc_forget();
err = -ENOMEM;
if (!forget)
Expand Down

0 comments on commit af109bc

Please sign in to comment.