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)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 30 Sep 2022 14:39:50 +0000 (17:39 +0300)
commit6d5c9e79b726cc473d40e9cb60976dbe8e669624
tree06efd61e38ceda6eb669fe14c42ad7284c5f03ec
parentf27b92ec0926efa3eadcebb97a90faba12e16041
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>
fs/ntfs3/attrib.c