diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-05-26 12:51:03 +0300 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2022-06-06 18:38:58 +0300 |
commit | 37a530bfe56ca9a0d3129598803f2794c7428aae (patch) | |
tree | 9e6dcc2d78a465dd1c63cee9ebdd1fdb58eb54ca | |
parent | 19d1b7872d1ebf0658b5032b79f536a715303ee4 (diff) | |
download | linux-stable-37a530bfe56ca9a0d3129598803f2794c7428aae.tar.gz linux-stable-37a530bfe56ca9a0d3129598803f2794c7428aae.tar.bz2 linux-stable-37a530bfe56ca9a0d3129598803f2794c7428aae.zip |
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: 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>
-rw-r--r-- | fs/ntfs3/inode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ntfs3/inode.c b/fs/ntfs3/inode.c index 38045264a61b..6c78930be035 100644 --- a/fs/ntfs3/inode.c +++ b/fs/ntfs3/inode.c @@ -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; |