]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ntfs3: pretend $Extend records as regular files
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Tue, 2 Sep 2025 10:43:24 +0000 (19:43 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:22 +0000 (15:34 -0500)
[ Upstream commit 4e8011ffec79717e5fdac43a7e79faf811a384b7 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ntfs3/inode.c

index 9077c7b6273364da1fc8cdbf83421bd752ec4650..4e2629d020b756a0b8d662b00d79dbb2940a6e08 100644 (file)
@@ -471,6 +471,7 @@ end_enum:
                   fname->home.seq == cpu_to_le16(MFT_REC_EXTEND)) {
                /* Records in $Extend are not a files or general directories. */
                inode->i_op = &ntfs_file_inode_operations;
+               mode = S_IFREG;
        } else {
                err = -EINVAL;
                goto out;