]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Sep 2022 09:11:18 +0000 (11:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 27 Sep 2022 09:11:18 +0000 (11:11 +0200)
added patches:
ext4-fixup-possible-uninitialized-variable-access-in-ext4_mb_choose_next_group_cr1.patch

queue-5.19/ext4-fixup-possible-uninitialized-variable-access-in-ext4_mb_choose_next_group_cr1.patch [new file with mode: 0644]
queue-5.19/series

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 (file)
index 0000000..013b9a2
--- /dev/null
@@ -0,0 +1,43 @@
+From a078dff870136090b5779ca2831870a6c5539d36 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+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 <jack@suse.cz>
+
+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 <dan.carpenter@oracle.com>
+Signed-off-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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)
index 32894bf090fe911c714b2f8e7d96074e2b8621e8..2454f7feb6295375d8347f2dbbf42e6e22bef48a 100644 (file)
@@ -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