Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ntfs3: pretend $Extend records as regular files

Since commit af153bb63a33 ("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 $Extend records.

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>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

authored by

Tetsuo Handa and committed by
Konstantin Komarov
4e8011ff 21dc07ac

+1
+1
fs/ntfs3/inode.c
··· 471 471 fname->home.seq == cpu_to_le16(MFT_REC_EXTEND)) { 472 472 /* Records in $Extend are not a files or general directories. */ 473 473 inode->i_op = &ntfs_file_inode_operations; 474 + mode = S_IFREG; 474 475 } else { 475 476 err = -EINVAL; 476 477 goto out;