forked from Minki/linux
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: 82cae269cf
("fs/ntfs3: Add initialization of super block")
Reported-by: Liangbin Lian <jjm2473@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
parent
19d1b7872d
commit
37a530bfe5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user