Re: [f2fs-dev] [PATCH v3] fsck.f2fs: sanitize invalid segment type during block update

From: Chao Yu

Date: Tue Aug 04 2026 - 21:25:00 EST


On 8/5/26 01:18, Daeho Jeong wrote:
> From: Daeho Jeong <daehojeong@xxxxxxxxxx>
>
> If an invalid segment type (type < 0 || type >= NO_CHECK_TYPE) is read
> from SIT during block update, update_block() now validates the type,
> reports corruption via ASSERT_MSG(), fixes se->type directly, and falls
> back to a valid active curseg type based on its SSA summary block type
> when fix_on is enabled. find_next_free_block() also validates want_type to
> prevent out-of-bounds accesses.
>
> Signed-off-by: Daeho Jeong <daehojeong@xxxxxxxxxx>
Reviewed-by: Chao Yu <chao@xxxxxxxxxx>

Thanks,