]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
fs/ntfs3: Fix missing i_op in ntfs_read_mft
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Thu, 26 May 2022 09:51:03 +0000 (12:51 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:45:27 +0000 (11:45 +0200)
commit 37a530bfe56ca9a0d3129598803f2794c7428aae upstream.

There is null pointer dereference because i_op == NULL.
The bug happens because we don't initialize i_op for records in $Extend.
Fixes: 82cae269cfa9 ("fs/ntfs3: Add initialization of super block")
Reported-by: Liangbin Lian <jjm2473@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ntfs3/inode.c

index be4ebdd8048b0454488114e89a4d6fe80ecaeb2f..803ff4c63c318dc9f01fa15664dd4ff9c36ac417 100644 (file)
@@ -430,6 +430,7 @@ end_enum:
        } else if (fname && fname->home.low == cpu_to_le32(MFT_REC_EXTEND) &&
                   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;
        } else {
                err = -EINVAL;
                goto out;