nilfs2: validate file block counts during recovery
nilfs_scan_dsync_log() trusts the block counts in each on-disk file
information entry. If fi_ndatablk is greater than fi_nblocks, the data
block loop can consume excessive summary entries and the later subtraction
used to derive the number of node blocks underflows.
Reject inconsistent file information entries before consuming their block
information.
Fixes: 0f3e1c7f23f8 ("nilfs2: recovery functions")
Cc: stable+noautosel@kernel.org # Non-fatal bug fix; defer backport until a real issue is reported
Signed-off-by: Aldo Ariel Panzardo <qwe.aldo@gmail.com>
Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Viacheslav Dubeyko <slava@dubeyko.com>
1 file changed