Re: [PATCH] ext4: avoid to access uninitialized block_cluster

From: Theodore Ts'o
Date: Thu Mar 23 2023 - 10:19:49 EST


On Tue, Mar 21, 2023 at 05:21:06AM +0800, Kemeng Shi wrote:
> If inode bitmap block and block bitmap block are in different group,
> there is a risk to access uninitialized block_cluster in
> ext4_num_overhead_clusters. Initialize block_cluster to -1 to fix this.
>
> Signed-off-by: Kemeng Shi <shikemeng@xxxxxxxxxxxxxxx>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Reported-by: Dan Carpenter <error27@xxxxxxxxx>
> Link: https://lore.kernel.org/r/202303171446.eLEhZzAu-lkp@xxxxxxxxx/
> Fixes: e3c70113e2cb ("ext4: improve inode table blocks counting in ext4_num_overhead_clusters")

Thanks for the fix-up and to Dan and the zero-day test bot for noting
the problem. Since I've needed to rebase the ext4 dev tree to pick up
an urgent fixup as well as deal with some other problematic commits,
I've merged this fix into the base commit "ext4: improve inode table
blocks counting in ext4_num_overhead_clusters".

Cheers,

- Ted