Commit 37a530bf authored by Konstantin Komarov's avatar Konstantin Komarov

fs/ntfs3: Fix missing i_op in ntfs_read_mft

There is null pointer dereference because i_op == NULL.
The bug happens because we don't initialize i_op for records in $Extend.
Fixes: 82cae269 ("fs/ntfs3: Add initialization of super block")
Reported-by: default avatarLiangbin Lian <jjm2473@gmail.com>
Signed-off-by: default avatarKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
parent 19d1b787
...@@ -430,6 +430,7 @@ static struct inode *ntfs_read_mft(struct inode *inode, ...@@ -430,6 +430,7 @@ static struct inode *ntfs_read_mft(struct inode *inode,
} else if (fname && fname->home.low == cpu_to_le32(MFT_REC_EXTEND) && } else if (fname && fname->home.low == cpu_to_le32(MFT_REC_EXTEND) &&
fname->home.seq == cpu_to_le16(MFT_REC_EXTEND)) { fname->home.seq == cpu_to_le16(MFT_REC_EXTEND)) {
/* Records in $Extend are not a files or general directories. */ /* Records in $Extend are not a files or general directories. */
inode->i_op = &ntfs_file_inode_operations;
} else { } else {
err = -EINVAL; err = -EINVAL;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment