linux/fs/ntfs3
Bartlomiej Kubik f772805722 fs/ntfs3: Initialize allocated memory before use
[ Upstream commit a8a3ca23bb ]

KMSAN reports: Multiple uninitialized values detected:

- KMSAN: uninit-value in ntfs_read_hdr (3)
- KMSAN: uninit-value in bcmp (3)

Memory is allocated by __getname(), which is a wrapper for
kmem_cache_alloc(). This memory is used before being properly
cleared. Change kmem_cache_alloc() to kmem_cache_zalloc() to
properly allocate and clear memory before use.

Fixes: 82cae269cf ("fs/ntfs3: Add initialization of super block")
Fixes: 78ab59fee0 ("fs/ntfs3: Rework file operations")
Tested-by: syzbot+332bd4e9d148f11a87dc@syzkaller.appspotmail.com
Reported-by: syzbot+332bd4e9d148f11a87dc@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=332bd4e9d148f11a87dc

Fixes: 82cae269cf ("fs/ntfs3: Add initialization of super block")
Fixes: 78ab59fee0 ("fs/ntfs3: Rework file operations")
Tested-by: syzbot+0399100e525dd9696764@syzkaller.appspotmail.com
Reported-by: syzbot+0399100e525dd9696764@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=0399100e525dd9696764

Reviewed-by: Khalid Aziz <khalid@kernel.org>
Signed-off-by: Bartlomiej Kubik <kubik.bartlomiej@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Li hongliang <1468888505@139.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-01-30 10:28:48 +01:00
..
lib Changes for 6.12-rc3 2024-10-08 10:53:06 -07:00
attrib.c fs/ntfs3: Update inode->i_mapping->a_ops on compression state 2025-04-10 14:39:22 +02:00
attrlist.c fs/ntfs3: Remove unused al_delete_le 2024-10-01 12:19:05 +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: Fix a resource leak bug in wnd_extend() 2025-10-19 16:33:49 +02: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: Add sanity check for file name 2025-08-20 18:30:21 +02:00
file.c fs/ntfs3: check for shutdown in fsync 2026-01-08 10:13:57 +01:00
frecord.c ntfs: Do not overwrite uptodate pages 2026-01-08 10:14:37 +01:00
fslog.c fs/ntfs3: Refactor enum_rstbl to suppress static checker 2024-09-03 16:58:42 +03:00
fsntfs.c ntfs3: fix uninit memory after failed mi_read in mi_format_new 2025-12-18 13:54:43 +01:00
index.c fs/ntfs3: reject index allocation if $BITMAP is empty but blocks exist 2025-10-15 12:00:10 +02:00
inode.c fs/ntfs3: Initialize allocated memory before use 2026-01-30 10:28:48 +01:00
Kconfig ntfs3: serve as alias for the legacy ntfs driver 2024-04-16 10:45:26 +02:00
lznt.c fs/ntfs3: Check if more than chunk-size bytes are written 2024-09-03 16:58:39 +03:00
Makefile fs/ntfs3: Add Kconfig, Makefile and doc 2021-08-13 07:56:37 -07:00
namei.c fs/ntfs3: cancle set bad inode after removing name fails 2025-08-15 12:13:32 +02:00
ntfs.h fs/ntfs3: Prevent integer overflow in hdr_first_de() 2025-04-10 14:39:23 +02:00
ntfs_fs.h fs/ntfs3: Support timestamps prior to epoch 2026-01-08 10:13:56 +01:00
record.c fs/ntfs3: Sequential field availability check in mi_enum_attr() 2024-10-01 12:19:07 +03:00
run.c fs/ntfs3: fix mount failure for sparse runs in run_unpack() 2026-01-08 10:14:15 +01:00
super.c ntfs: set dummy blocksize to read boot_block when mounting 2026-01-08 10:13:56 +01:00
upcase.c fs/ntfs3: Add option "nocase" 2022-09-30 17:39:47 +03:00
xattr.c fs/ntfs3: Rename ntfs3_setattr into ntfs_setattr 2024-09-03 16:58:45 +03:00