]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
fs/ntfs3: avoid calling run_get_entry() when run == NULL in ntfs_read_run_nb_ra()
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 9 Feb 2026 15:07:32 +0000 (16:07 +0100)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:20:44 +0000 (07:20 -0500)
commitb8a4ef4b984b91a36b0fbd7ed14fcd983c5f348f
treed360d8da73bf591faca0b189803cd734345c43c0
parentb8d22d9d8260b0f4f4d8e2898c98037c9982ea66
fs/ntfs3: avoid calling run_get_entry() when run == NULL in ntfs_read_run_nb_ra()

[ Upstream commit c5226b96c08a010ebef5fdf4c90572bcd89e4299 ]

When ntfs_read_run_nb_ra() is invoked with run == NULL the code later
assumes run is valid and may call run_get_entry(NULL, ...), and also
uses clen/idx without initializing them. Smatch reported uninitialized
variable warnings and this can lead to undefined behaviour. This patch
fixes it.

Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/202512230646.v5hrYXL0-lkp@intel.com/
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ntfs3/fsntfs.c