From: Miklos Szeredi Date: Wed, 15 Aug 2012 11:01:24 +0000 (+0200) Subject: fuse: check create mode in atomic open X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=af109bca94a8a223c4632a4ff769b3419fe7ed8c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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: Steve Reported-by: Richard W.M. Jones Signed-off-by: Miklos Szeredi Tested-by: Richard W.M. Jones --- diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 8964cf3999b2..324bc0850534 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -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)