Commit af109bca authored by Miklos Szeredi's avatar Miklos Szeredi

fuse: check create mode in atomic open

Verify that the VFS is passing us a complete create mode with the S_IFREG to
atomic open.
Reported-by: default avatarSteve <steveamigauk@yahoo.co.uk>
Reported-by: default avatarRichard W.M. Jones <rjones@redhat.com>
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Tested-by: default avatarRichard W.M. Jones <rjones@redhat.com>
parent 38227f78
...@@ -383,6 +383,9 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry, ...@@ -383,6 +383,9 @@ static int fuse_create_open(struct inode *dir, struct dentry *entry,
struct fuse_entry_out outentry; struct fuse_entry_out outentry;
struct fuse_file *ff; struct fuse_file *ff;
/* Userspace expects S_IFREG in create mode */
BUG_ON((mode & S_IFMT) != S_IFREG);
forget = fuse_alloc_forget(); forget = fuse_alloc_forget();
err = -ENOMEM; err = -ENOMEM;
if (!forget) if (!forget)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment