fs/ntfs3: Fix attr_punch_hole() null pointer derenference
authorAlon Zahavi <zahavi.alon@gmail.com>
Mon, 15 Aug 2022 11:07:12 +0000 (14:07 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jan 2023 06:22:48 +0000 (07:22 +0100)
commit9cca110cf8bb0653b423dba7a7c4cc23ccf91b28
tree62ca8e7fa51e70eae0a8fcca84ac9400ebe4a8d6
parentd4d112e5c458e07eee74139aab0f9c4297dd7018
fs/ntfs3: Fix attr_punch_hole() null pointer derenference

commit 6d5c9e79b726cc473d40e9cb60976dbe8e669624 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ntfs3/attrib.c