Skip to content

Commit ed8889c

Browse files
Tetsuo Handadubeyko
authored andcommitted
hfsplus: pretend special inodes as regular files
Since commit af153bb ("vfs: catch invalid modes in may_open()") requires any inode be one of S_IFDIR/S_IFLNK/S_IFREG/S_IFCHR/S_IFBLK/ S_IFIFO/S_IFSOCK type, use S_IFREG for special inodes. Reported-by: syzbot <syzbot+895c23f6917da440ed0d@syzkaller.appspotmail.com> Closes: https://syzkaller.appspot.com/bug?extid=895c23f6917da440ed0d Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Reviewed-by: Viacheslav Dubeyko <slava@dubeyko.com> Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com> Link: https://lore.kernel.org/r/d0a07b1b-8b73-4002-8e29-e2bd56871262@I-love.SAKURA.ne.jp Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
1 parent d8a73cc commit ed8889c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

fs/hfsplus/super.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ static int hfsplus_system_read_inode(struct inode *inode)
5353
return -EIO;
5454
}
5555

56+
/*
57+
* Assign a dummy file type, for may_open() requires that
58+
* an inode has a valid file type.
59+
*/
60+
inode->i_mode = S_IFREG;
61+
5662
return 0;
5763
}
5864

0 commit comments

Comments
 (0)