f2fs: fix to detect potential corrupted nid in free_nid_list

[ Upstream commit 8fc6056dcf ]

As reported, on-disk footer.ino and footer.nid is the same and
out-of-range, let's add sanity check on f2fs_alloc_nid() to detect
any potential corruption in free_nid_list.

Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Chao Yu 2025-08-07 10:44:31 +08:00 • committed by Greg Kroah-Hartman
commit adbcb34f03
2 changed files with 17 additions and 1 deletions