syzbot


kernel BUG in kvfree

Status: fixed on 2023/06/13 08:16
Reported-by: syzbot+462b5bfa37ec027f4e5b@syzkaller.appspotmail.com
Fix commit: 1a8822343e67 ext4: fix invalid free tracking in ext4_xattr_move_to_block()
First crash: 564d, last: 564d
Cause bisection: introduced by (bisect log) :
commit d738789ae9ec47d3458a008788f3cdc862ebf0cb
Author: Jun Nie <jun.nie@linaro.org>
Date: Tue Jan 3 01:45:16 2023 +0000

  ext4: optimize ea_inode block expansion

Crash: kernel BUG in kvfree (log)
Repro: C syz .config
  
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-5.15 kernel BUG in kvfree C error 11 558d 600d 0/3 auto-obsoleted due to no activity on 2023/08/22 15:17

Sample crash report:
EXT4-fs (loop0): mounted filesystem without journal. Opts: inode_readahead_blks=0x0000000000000000,errors=continue,debug_want_extra_isize=0x0000000000000040,dioread_nolock,max_batch_time=0x0000000000000008,nombcache,,errors=continue
------------[ cut here ]------------
kernel BUG at mm/slub.c:4184!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 292 Comm: syz-executor356 Not tainted 5.10.177-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023
RIP: 0010:kfree+0x269/0x270 mm/slub.c:4184
Code: 08 4c 89 ee 48 89 da e8 55 63 f2 ff 65 ff 0d ea 7a 5b 7e 0f 85 d2 fd ff ff e8 2f 8c 59 ff e9 c8 fd ff ff e8 a9 c1 02 03 0f 0b <0f> 0b 0f 1f 44 00 00 55 48 89 e5 53 48 83 ec 18 89 f2 65 48 8b 04
RSP: 0018:ffffc9000095f780 EFLAGS: 00010246

RAX: ffffea0004647f48 RBX: ffff88811da165a4 RCX: ffffea0004768580
RDX: 0000000000000000 RSI: 0000000000000012 RDI: ffff88811da165a4
RBP: ffffc9000095f7d8 R08: ffffffff81ed6729 R09: 0000000000000003
R10: fffff5200012be70 R11: dffffc0000000001 R12: 0000000000000000
R13: ffffffff81979c15 R14: 0000000000000000 R15: ffffea0004768580
FS:  000055555614b300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020002000 CR3: 000000011b047000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 kvfree+0x35/0x40 mm/util.c:647
 ext4_xattr_move_to_block fs/ext4/xattr.c:2643 [inline]
 ext4_xattr_make_inode_space fs/ext4/xattr.c:2706 [inline]
 ext4_expand_extra_isize_ea+0x1124/0x1e60 fs/ext4/xattr.c:2798
 __ext4_expand_extra_isize+0x303/0x3f0 fs/ext4/inode.c:5928
 ext4_try_to_expand_extra_isize fs/ext4/inode.c:5971 [inline]
 __ext4_mark_inode_dirty+0x4a7/0x7b0 fs/ext4/inode.c:6048
 __ext4_unlink+0x8b5/0xac0 fs/ext4/namei.c:3389
 ext4_unlink+0x142/0x3f0 fs/ext4/namei.c:3432
 vfs_unlink+0x23b/0x510 fs/namei.c:3977
 do_unlinkat+0x430/0x8b0 fs/namei.c:4042
 __do_sys_unlinkat fs/namei.c:4083 [inline]
 __se_sys_unlinkat fs/namei.c:4076 [inline]
 __x64_sys_unlinkat+0xcd/0xf0 fs/namei.c:4076
 do_syscall_64+0x34/0x70
 entry_SYSCALL_64_after_hwframe+0x61/0xc6
RIP: 0033:0x7ff917c5cc19
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffd31787278 EFLAGS: 00000246 ORIG_RAX: 0000000000000107
RAX: ffffffffffffffda RBX: 0031656c69662f2e RCX: 00007ff917c5cc19
RDX: 0000000000000000 RSI: 0000000020000000 RDI: 0000000000000003
RBP: 00007ff917c1c250 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007ff917c1c2e0
R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
Modules linked in:
---[ end trace 124e3bede6c226d4 ]---
RIP: 0010:kfree+0x269/0x270 mm/slub.c:4184
Code: 08 4c 89 ee 48 89 da e8 55 63 f2 ff 65 ff 0d ea 7a 5b 7e 0f 85 d2 fd ff ff e8 2f 8c 59 ff e9 c8 fd ff ff e8 a9 c1 02 03 0f 0b <0f> 0b 0f 1f 44 00 00 55 48 89 e5 53 48 83 ec 18 89 f2 65 48 8b 04
RSP: 0018:ffffc9000095f780 EFLAGS: 00010246
RAX: ffffea0004647f48 RBX: ffff88811da165a4 RCX: ffffea0004768580
RDX: 0000000000000000 RSI: 0000000000000012 RDI: ffff88811da165a4
RBP: ffffc9000095f7d8 R08: ffffffff81ed6729 R09: 0000000000000003
R10: fffff5200012be70 R11: dffffc0000000001 R12: 0000000000000000
R13: ffffffff81979c15 R14: 0000000000000000 R15: ffffea0004768580
FS:  000055555614b300(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020002000 CR3: 000000011b047000 CR4: 00000000003506b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/05/06 22:22 android13-5.10-lts 3ad342cf5b2c 90c93c40 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-android-5-10 kernel BUG in kvfree
* Struck through repros no longer work on HEAD.