linux-stable/fs/ntfs3
Jia-Ju Bai ec275bf969
fs/ntfs3: Fix a possible null-pointer dereference in ni_clear()
In a previous commit c1006bd13146, ni->mi.mrec in ni_write_inode()
could be NULL, and thus a NULL check is added for this variable.

However, in the same call stack, ni->mi.mrec can be also dereferenced
in ni_clear():

ntfs_evict_inode(inode)
  ni_write_inode(inode, ...)
    ni = ntfs_i(inode);
    is_rec_inuse(ni->mi.mrec) -> Add a NULL check by previous commit
  ni_clear(ntfs_i(inode))
    is_rec_inuse(ni->mi.mrec) -> No check

Thus, a possible null-pointer dereference may exist in ni_clear().
To fix it, a NULL check is added in this function.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
2023-03-27 16:59:16 +04:00
..
lib fs/ntfs3: Add missing header and guards to lib/ headers 2021-09-13 19:41:44 +03:00
attrib.c fs/ntfs3: Restore correct state after ENOSPC in attr_data_get_block 2022-11-14 19:50:46 +03:00
attrlist.c fs/ntfs3: Validate data run offset 2022-09-30 17:39:49 +03:00
bitfunc.c fs/ntfs3: Add ntfs_bitmap_weight_le function and refactoring 2022-11-14 19:50:42 +03:00
bitmap.c fs/ntfs3: Refactoring of various minor issues 2023-03-27 16:59:16 +04:00
debug.h fs/ntfs3. Add forward declarations for structs to debug.h 2021-09-13 19:41:43 +03:00
dir.c fs/ntfs3: Fix sparse problems 2022-11-14 19:50:42 +03:00
file.c fs.idmapped.v6.3 2023-02-20 11:53:11 -08:00
frecord.c fs/ntfs3: Fix a possible null-pointer dereference in ni_clear() 2023-03-27 16:59:16 +04:00
fslog.c fs/ntfs3: Fix slab-out-of-bounds read in hdr_delete_de() 2023-03-27 16:59:12 +04:00
fsntfs.c fs/ntfs3: Refactoring of various minor issues 2023-03-27 16:59:16 +04:00
index.c fs/ntfs3: Restore overflow checking for attr size in mi_enum_attr 2023-03-27 16:59:15 +04:00
inode.c fs/ntfs3: Improved checking of attribute's name length 2023-03-27 16:59:14 +04:00
Kconfig fs: build the legacy direct I/O code conditionally 2023-01-26 10:30:56 -07:00
lznt.c fs/ntfs3: Remove tabs before spaces from comment 2021-09-16 17:01:36 +03:00
Makefile
namei.c fs/ntfs3: Refactoring of various minor issues 2023-03-27 16:59:16 +04:00
ntfs.h fs/ntfs3: Refactoring of various minor issues 2023-03-27 16:59:16 +04:00
ntfs_fs.h fs/ntfs3: Fix slab-out-of-bounds read in hdr_delete_de() 2023-03-27 16:59:12 +04:00
record.c fs/ntfs3: Restore overflow checking for attr size in mi_enum_attr 2023-03-27 16:59:15 +04:00
run.c fs/ntfs3: Improve checking of bad clusters 2022-11-14 19:50:48 +03:00
super.c fs/ntfs3: Restore overflow checking for attr size in mi_enum_attr 2023-03-27 16:59:15 +04:00
upcase.c fs/ntfs3: Add option "nocase" 2022-09-30 17:39:47 +03:00
xattr.c fs/ntfs3: fix spelling mistake "attibute" -> "attribute" 2023-03-27 16:59:13 +04:00