From: Greg Kroah-Hartman Date: Tue, 27 Sep 2022 09:11:18 +0000 (+0200) Subject: 5.19-stable patches X-Git-Tag: v4.9.330~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5d8c803e4a97f1b95d7f3780addbc3ea278529e3;p=thirdparty%2Fkernel%2Fstable-queue.git 5.19-stable patches added patches: ext4-fixup-possible-uninitialized-variable-access-in-ext4_mb_choose_next_group_cr1.patch --- diff --git a/queue-5.19/ext4-fixup-possible-uninitialized-variable-access-in-ext4_mb_choose_next_group_cr1.patch b/queue-5.19/ext4-fixup-possible-uninitialized-variable-access-in-ext4_mb_choose_next_group_cr1.patch new file mode 100644 index 00000000000..013b9a26a2b --- /dev/null +++ b/queue-5.19/ext4-fixup-possible-uninitialized-variable-access-in-ext4_mb_choose_next_group_cr1.patch @@ -0,0 +1,43 @@ +From a078dff870136090b5779ca2831870a6c5539d36 Mon Sep 17 00:00:00 2001 +From: Jan Kara +Date: Thu, 22 Sep 2022 11:09:29 +0200 +Subject: ext4: fixup possible uninitialized variable access in ext4_mb_choose_next_group_cr1() + +From: Jan Kara + +commit a078dff870136090b5779ca2831870a6c5539d36 upstream. + +Variable 'grp' may be left uninitialized if there's no group with +suitable average fragment size (or larger). Fix the problem by +initializing it earlier. + +Link: https://lore.kernel.org/r/20220922091542.pkhedytey7wzp5fi@quack3 +Fixes: 83e80a6e3543 ("ext4: use buckets for cr 1 block scan instead of rbtree") +Cc: stable@kernel.org +Reported-by: Dan Carpenter +Signed-off-by: Jan Kara +Signed-off-by: Theodore Ts'o +Signed-off-by: Greg Kroah-Hartman +--- + fs/ext4/mballoc.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/fs/ext4/mballoc.c ++++ b/fs/ext4/mballoc.c +@@ -910,7 +910,7 @@ static void ext4_mb_choose_next_group_cr + int *new_cr, ext4_group_t *group, ext4_group_t ngroups) + { + struct ext4_sb_info *sbi = EXT4_SB(ac->ac_sb); +- struct ext4_group_info *grp, *iter; ++ struct ext4_group_info *grp = NULL, *iter; + int i; + + if (unlikely(ac->ac_flags & EXT4_MB_CR1_OPTIMIZED)) { +@@ -927,7 +927,6 @@ static void ext4_mb_choose_next_group_cr + read_unlock(&sbi->s_mb_avg_fragment_size_locks[i]); + continue; + } +- grp = NULL; + list_for_each_entry(iter, &sbi->s_mb_avg_fragment_size[i], + bb_avg_fragment_size_node) { + if (sbi->s_mb_stats) diff --git a/queue-5.19/series b/queue-5.19/series index 32894bf090f..2454f7feb62 100644 --- a/queue-5.19/series +++ b/queue-5.19/series @@ -204,3 +204,4 @@ ext4-avoid-unnecessary-spreading-of-allocations-among-groups.patch ext4-use-locality-group-preallocation-for-small-closed-files.patch ext4-use-buckets-for-cr-1-block-scan-instead-of-rbtree.patch revert-block-freeze-the-queue-earlier-in-del_gendisk.patch +ext4-fixup-possible-uninitialized-variable-access-in-ext4_mb_choose_next_group_cr1.patch