Skip to content

Commit 15545bc

Browse files
AlonZangboonkhai
authored andcommitted
fs/ntfs3: Fix attr_punch_hole() null pointer derenference
The bug occours due to a misuse of `attr` variable instead of `attr_b`. `attr` is being initialized as NULL, then being derenfernced as `attr->res.data_size`. This bug causes a crash of the ntfs3 driver itself, If compiled directly to the kernel, it crashes the whole system. Signed-off-by: Alon Zahavi <zahavi.alon@gmail.com> Co-developed-by: Tal Lossos <tallossos@gmail.com> Signed-off-by: Tal Lossos <tallossos@gmail.com> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent 74a6984 commit 15545bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ntfs3/attrib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2020,7 +2020,7 @@ int attr_punch_hole(struct ntfs_inode *ni, u64 vbo, u64 bytes, u32 *frame_size)
20202020
return -ENOENT;
20212021

20222022
if (!attr_b->non_res) {
2023-
u32 data_size = le32_to_cpu(attr->res.data_size);
2023+
u32 data_size = le32_to_cpu(attr_b->res.data_size);
20242024
u32 from, to;
20252025

20262026
if (vbo > data_size)

0 commit comments

Comments
 (0)