ext4: no need to continue when the number of entries is 1

Fixes: ac27a0ec11 ("[PATCH] ext4: initial copy of files from ext3")
Reported-by: syzbot+ae688d469e36fb5138d0@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=ae688d469e36fb5138d0
Signed-off-by: Edward Adam Davis <eadavis@qq.com>
Reported-and-tested-by: syzbot+ae688d469e36fb5138d0@syzkaller.appspotmail.com
Link: https://patch.msgid.link/tencent_BE7AEE6C7C2D216CB8949CE8E6EE7ECC2C0A@qq.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org

CVE-2024-49967
(cherry picked from commit 1a00a393d6a7fb1e745a41edd09019bd6a0ad64c)
Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
Acked-by: Yuxuan Luo <yuxuan.luo@canonical.com>
Acked-by: Magali Lemes <magali.lemes@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
This commit is contained in:
Edward Adam Davis
2024-11-20 08:19:00 +01:00
committed by Manuel Diewald
parent c3825cd5ac
commit 7df5984280
+1 -1
View File
@@ -2045,7 +2045,7 @@ static struct ext4_dir_entry_2 *do_split(handle_t *handle, struct inode *dir,
split = count/2;
hash2 = map[split].hash;
continued = hash2 == map[split - 1].hash;
continued = split > 0 ? hash2 == map[split - 1].hash : 0;
dxtrace(printk(KERN_INFO "Split block %lu at %x, %i/%i\n",
(unsigned long)dx_get_block(frame->at),
hash2, split, count-split));