[PATCH] ext4: fix kernel BUG-in-ext4_free_blocks

6 views
Skip to first unread message

Tadeusz Struk

unread,
Jul 13, 2022, 1:28:09 PM7/13/22
to syzbot+15cd99...@syzkaller.appspotmail.com, syzkaller-a...@googlegroups.com, tadeus...@linaro.org
#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c
index 78ee3ef795ae..1175750ad05f 100644
--- a/fs/ext4/balloc.c
+++ b/fs/ext4/balloc.c
@@ -56,6 +56,9 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr,
struct ext4_super_block *es = EXT4_SB(sb)->s_es;
ext4_grpblk_t offset;

+ if (blocknr < le32_to_cpu(es->s_first_data_block))
+ blocknr = le32_to_cpu(es->s_first_data_block);
+
blocknr = blocknr - le32_to_cpu(es->s_first_data_block);
offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)) >>
EXT4_SB(sb)->s_cluster_bits;
--
2.36.1

syzbot

unread,
Jul 13, 2022, 1:44:20 PM7/13/22
to syzkaller-a...@googlegroups.com, tadeus...@linaro.org
Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Reported-and-tested-by: syzbot+15cd99...@syzkaller.appspotmail.com

Tested on:

commit: b047602d Merge tag 'trace-v5.19-rc5' of git://git.kern..
git tree: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
console output: https://syzkaller.appspot.com/x/log.txt?x=124a90ac080000
kernel config: https://syzkaller.appspot.com/x/.config?x=416bd8aed6ca51ae
dashboard link: https://syzkaller.appspot.com/bug?extid=15cd994e273307bf5cfa
compiler: Debian clang version 13.0.1-++20220126092033+75e33f71c2da-1~exp1~20220126212112.63, GNU ld (GNU Binutils for Debian) 2.35.2
patch: https://syzkaller.appspot.com/x/patch.diff?x=140fb51c080000

Note: testing is done by a robot and is best-effort only.
Reply all
Reply to author
Forward
0 new messages