Skip to content

Commit

Permalink
ext4: no need to continue when the number of entries is 1
Browse files Browse the repository at this point in the history
Fixes: ac27a0e ("[PATCH] ext4: initial copy of files from ext3")
Reported-by: [email protected]
Closes: https://syzkaller.appspot.com/bug?extid=ae688d469e36fb5138d0
Signed-off-by: Edward Adam Davis <[email protected]>
Reported-and-tested-by: [email protected]
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Cc: [email protected]

CVE-2024-49967
(cherry picked from commit 1a00a39)
Signed-off-by: Koichiro Den <[email protected]>
Acked-by: Yuxuan Luo <[email protected]>
Acked-by: Magali Lemes <[email protected]>
Signed-off-by: Stefan Bader <[email protected]>
  • Loading branch information
ea1davis authored and mdiewa committed Nov 30, 2024
1 parent c3825cd commit 7df5984
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 7df5984

Please sign in to comment.