bisecting fixing commit since a1b977b49b66c75e6c51a515f6700371ae720217 building syzkaller on d32b0bbf2f8cfe548553c4012e2c0f79040d999f testing commit a1b977b49b66c75e6c51a515f6700371ae720217 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 2da95bdc91d204feb3c33d8be85cf4f5b18f12313738fb1eec4b6e503d5a1a4c run #0: crashed: general protection fault in diFree run #1: crashed: KASAN: use-after-free Read in diFree run #2: crashed: KASAN: use-after-free Read in diFree run #3: crashed: KASAN: use-after-free Read in diFree run #4: crashed: KASAN: use-after-free Read in diFree run #5: crashed: KASAN: use-after-free Read in diFree run #6: crashed: KASAN: use-after-free Read in diFree run #7: crashed: general protection fault in diFree run #8: crashed: KASAN: use-after-free Read in diFree run #9: crashed: general protection fault in diFree run #10: crashed: general protection fault in diFree run #11: crashed: general protection fault in diFree run #12: crashed: KASAN: use-after-free Read in diFree run #13: crashed: KASAN: use-after-free Read in diFree run #14: crashed: KASAN: use-after-free Read in diFree run #15: crashed: KASAN: use-after-free Read in diFree run #16: crashed: KASAN: use-after-free Read in diFree run #17: crashed: general protection fault in diFree run #18: crashed: KASAN: use-after-free Read in diFree run #19: crashed: general protection fault in diFree testing current HEAD 59456c9cc40c8f75b5a7efa0fe1f211d9c6fcaf1 testing commit 59456c9cc40c8f75b5a7efa0fe1f211d9c6fcaf1 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 233148cd60a887daf9c409c2ac49fa62703552d4888da7ec850de48ab7f6e223 run #0: crashed: KASAN: use-after-free Read in diFree run #1: crashed: general protection fault in diFree run #2: crashed: KASAN: use-after-free Read in diFree run #3: crashed: KASAN: use-after-free Read in diFree run #4: crashed: KASAN: use-after-free Read in diFree run #5: crashed: KASAN: use-after-free Read in diFree run #6: crashed: general protection fault in diFree run #7: crashed: general protection fault in diFree run #8: crashed: general protection fault in diFree run #9: crashed: KASAN: use-after-free Read in diFree revisions tested: 2, total time: 31m26.926918382s (build: 24m17.523268668s, test: 6m32.609126598s) the crash still happens on HEAD commit msg: Linux 4.19.204 crash: KASAN: use-after-free Read in diFree ERROR: (device loop3): xtSearch: XT_GETPAGE: xtree page corrupt ERROR: (device loop1): xtSearch: XT_GETPAGE: xtree page corrupt ERROR: (device loop5): xtSearch: XT_GETPAGE: xtree page corrupt ================================================================== BUG: KASAN: use-after-free in diFree+0x1581/0x32f0 fs/jfs/jfs_imap.c:886 Read of size 4 at addr ffff8881d6710b44 by task syz-executor.2/8213 CPU: 1 PID: 8213 Comm: syz-executor.2 Not tainted 4.19.204-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 print_address_description.cold.6+0x9/0x211 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:396 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 diFree+0x1581/0x32f0 fs/jfs/jfs_imap.c:886 jfs_evict_inode+0x14f/0x1b0 fs/jfs/inode.c:165 evict+0x29c/0x590 fs/inode.c:559 iput_final fs/inode.c:1555 [inline] iput fs/inode.c:1581 [inline] iput+0x378/0x6b0 fs/inode.c:1567 diFreeSpecial fs/jfs/jfs_imap.c:563 [inline] diFreeSpecial+0x5d/0x80 fs/jfs/jfs_imap.c:555 jfs_umount+0xce/0x300 fs/jfs/jfs_umount.c:78 jfs_fill_super+0x625/0xb10 fs/jfs/super.c:633 mount_bdev+0x26f/0x330 fs/super.c:1158 jfs_do_mount+0x10/0x20 fs/jfs/super.c:703 mount_fs+0x7f/0x2b0 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2483 [inline] do_mount+0x376/0x2630 fs/namespace.c:2813 ksys_mount+0xb1/0xd0 fs/namespace.c:3029 __do_sys_mount fs/namespace.c:3043 [inline] __se_sys_mount fs/namespace.c:3040 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3040 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x466d6a Code: 48 c7 c2 bc ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fde5f840fa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 0000000000466d6a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fde5f841000 RBP: 00007fde5f841040 R08: 00007fde5f841040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fde5f841000 R15: 000000002006d200 Allocated by task 8213: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:553 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:538 kmem_cache_alloc_trace+0x152/0x3a0 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] diMount+0x4d/0x690 fs/jfs/jfs_imap.c:118 jfs_mount+0x27f/0x340 fs/jfs/jfs_mount.c:191 jfs_fill_super+0x52c/0xb10 fs/jfs/super.c:589 mount_bdev+0x26f/0x330 fs/super.c:1158 jfs_do_mount+0x10/0x20 fs/jfs/super.c:703 mount_fs+0x7f/0x2b0 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2483 [inline] do_mount+0x376/0x2630 fs/namespace.c:2813 ksys_mount+0xb1/0xd0 fs/namespace.c:3029 __do_sys_mount fs/namespace.c:3043 [inline] __se_sys_mount fs/namespace.c:3040 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3040 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 8213: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x13c/0x220 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 diUnmount+0xdb/0x120 fs/jfs/jfs_imap.c:210 jfs_umount+0xc6/0x300 fs/jfs/jfs_umount.c:76 jfs_fill_super+0x625/0xb10 fs/jfs/super.c:633 mount_bdev+0x26f/0x330 fs/super.c:1158 jfs_do_mount+0x10/0x20 fs/jfs/super.c:703 mount_fs+0x7f/0x2b0 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2483 [inline] do_mount+0x376/0x2630 fs/namespace.c:2813 ksys_mount+0xb1/0xd0 fs/namespace.c:3029 __do_sys_mount fs/namespace.c:3043 [inline] __se_sys_mount fs/namespace.c:3040 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3040 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8881d6710b40 which belongs to the cache kmalloc-32768 of size 32768 The buggy address is located 4 bytes inside of 32768-byte region [ffff8881d6710b40, ffff8881d6718b40) The buggy address belongs to the page: page:ffffea000759c400 count:1 mapcount:0 mapping:ffff8881f6002380 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffffea000751fc08 ffffea000737b008 ffff8881f6002380 raw: 0000000000000000 ffff8881d6710b40 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d6710a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881d6710a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881d6710b00: fc fc fc fc fc fc fc fc fb fb fb fb fb fb fb fb ^ ffff8881d6710b80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881d6710c00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ERROR: (device loop4): xtSearch: XT_GETPAGE: xtree page corrupt ERROR: (device loop3): xtSearch: XT_GETPAGE: xtree page corrupt kasan: CONFIG_KASAN_INLINE enabled kasan: GPF could be caused by NULL-ptr deref or user memory access imap: 00000000e39d2392: 00000000 00000000 00000000 00000000 general protection fault: 0000 [#1] PREEMPT SMP KASAN CPU: 1 PID: 8217 Comm: syz-executor.4 Tainted: G B 4.19.204-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:diFree+0x1bd/0x32f0 fs/jfs/jfs_imap.c:886 imap: 00000000949299c7: 00000000 00000000 00000000 00000000 Code: 8b 68 80 48 8b 85 28 fe ff ff 49 8d 5d 04 48 c1 e8 0c 48 89 da 48 c1 ea 03 48 89 85 30 fe ff ff 48 b8 00 00 00 00 00 fc ff df <0f> b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 a3 RSP: 0018:ffff8881cda47788 EFLAGS: 00010247 RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881c85d0568 RBP: ffff8881cda47a38 R08: ffffed10390ba0cf R09: ffffed10390ba0ce R10: ffffed10390ba0ce R11: ffff8881c85d0673 R12: ffff8881d4681e00 R13: 0000000000000000 R14: ffff8881cda47a10 R15: ffff8881c85d05e8 FS: 00007fdeb21e2700(0000) GS:ffff8881f6700000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f81413fb000 CR3: 00000001d530c005 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ERROR: (device loop0): diFree: inum = 16, iagno = 0, nextiag = -30591 ERROR: (device loop5): xtSearch: XT_GETPAGE: xtree page corrupt jfs_evict_inode+0x14f/0x1b0 fs/jfs/inode.c:165 evict+0x29c/0x590 fs/inode.c:559 iput_final fs/inode.c:1555 [inline] iput fs/inode.c:1581 [inline] iput+0x378/0x6b0 fs/inode.c:1567 diFreeSpecial fs/jfs/jfs_imap.c:563 [inline] diFreeSpecial+0x5d/0x80 fs/jfs/jfs_imap.c:555 jfs_mount+0x295/0x340 fs/jfs/jfs_mount.c:202 jfs_fill_super+0x52c/0xb10 fs/jfs/super.c:589 mount_bdev+0x26f/0x330 fs/super.c:1158 jfs_do_mount+0x10/0x20 fs/jfs/super.c:703 mount_fs+0x7f/0x2b0 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2483 [inline] do_mount+0x376/0x2630 fs/namespace.c:2813 ksys_mount+0xb1/0xd0 fs/namespace.c:3029 __do_sys_mount fs/namespace.c:3043 [inline] __se_sys_mount fs/namespace.c:3040 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3040 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x466d6a Code: 48 c7 c2 bc ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fdeb21e1fa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 0000000000466d6a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fdeb21e2000 RBP: 00007fdeb21e2040 R08: 00007fdeb21e2040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fdeb21e2000 R15: 000000002006d200 Modules linked in: ---[ end trace d101c43fb99c337b ]--- kasan: CONFIG_KASAN_INLINE enabled RIP: 0010:diFree+0x1bd/0x32f0 fs/jfs/jfs_imap.c:886 Code: 8b 68 80 48 8b 85 28 fe ff ff 49 8d 5d 04 48 c1 e8 0c 48 89 da 48 c1 ea 03 48 89 85 30 fe ff ff 48 b8 00 00 00 00 00 fc ff df <0f> b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 a3 kasan: GPF could be caused by NULL-ptr deref or user memory access RSP: 0018:ffff8881cda47788 EFLAGS: 00010247 RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881c85d0568 general protection fault: 0000 [#2] PREEMPT SMP KASAN RBP: ffff8881cda47a38 R08: ffffed10390ba0cf R09: ffffed10390ba0ce CPU: 0 PID: 8223 Comm: syz-executor.5 Tainted: G B D 4.19.204-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:diFree+0x1bd/0x32f0 fs/jfs/jfs_imap.c:886 Code: 8b 68 80 48 8b 85 28 fe ff ff 49 8d 5d 04 48 c1 e8 0c 48 89 da 48 c1 ea 03 48 89 85 30 fe ff ff 48 b8 00 00 00 00 00 fc ff df <0f> b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 a3 RSP: 0018:ffff8881cdac7788 EFLAGS: 00010247 RAX: dffffc0000000000 RBX: 0000000000000004 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8881c87d23e8 RBP: ffff8881cdac7a38 R08: ffffed10390fa49f R09: ffffed10390fa49e R10: ffffed10390fa49e R11: ffff8881c87d24f3 R12: ffff8881f4614080 R13: 0000000000000000 R14: ffff8881cdac7a10 R15: ffff8881c87d2468 FS: 00007fd73b378700(0000) GS:ffff8881f6600000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8141499008 CR3: 00000001e8e7d003 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: R10: ffffed10390ba0ce R11: ffff8881c85d0673 R12: ffff8881d4681e00 jfs_evict_inode+0x14f/0x1b0 fs/jfs/inode.c:165 evict+0x29c/0x590 fs/inode.c:559 iput_final fs/inode.c:1555 [inline] iput fs/inode.c:1581 [inline] iput+0x378/0x6b0 fs/inode.c:1567 diFreeSpecial fs/jfs/jfs_imap.c:563 [inline] diFreeSpecial+0x5d/0x80 fs/jfs/jfs_imap.c:555 jfs_mount+0x295/0x340 fs/jfs/jfs_mount.c:202 jfs_fill_super+0x52c/0xb10 fs/jfs/super.c:589 mount_bdev+0x26f/0x330 fs/super.c:1158 R13: 0000000000000000 R14: ffff8881cda47a10 R15: ffff8881c85d05e8 jfs_do_mount+0x10/0x20 fs/jfs/super.c:703 mount_fs+0x7f/0x2b0 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2483 [inline] do_mount+0x376/0x2630 fs/namespace.c:2813 FS: 00007fdeb21e2700(0000) GS:ffff8881f6700000(0000) knlGS:0000000000000000 ksys_mount+0xb1/0xd0 fs/namespace.c:3029 __do_sys_mount fs/namespace.c:3043 [inline] __se_sys_mount fs/namespace.c:3040 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3040 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x466d6a Code: 48 c7 c2 bc ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fd73b377fa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 0000000000466d6a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fd73b378000 RBP: 00007fd73b378040 R08: 00007fd73b378040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fd73b378000 R15: 000000002006d200 Modules linked in: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 ---[ end trace d101c43fb99c337c ]--- CR2: 0000000000558000 CR3: 00000001d530c006 CR4: 00000000001606e0 RIP: 0010:diFree+0x1bd/0x32f0 fs/jfs/jfs_imap.c:886 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 Code: 8b 68 80 48 8b 85 28 fe ff ff 49 8d 5d 04 48 c1 e8 0c 48 89 da 48 c1 ea 03 48 89 85 30 fe ff ff 48 b8 00 00 00 00 00 fc ff df <0f> b6 14 02 48 89 d8 83 e0 07 83 c0 03 38 d0 7c 08 84 d2 0f 85 a3 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 RSP: 0018:ffff8881cda47788 EFLAGS: 00010247 ---------------- Code disassembly (best guess): 0: 8b 68 80 mov -0x80(%rax),%ebp 3: 48 8b 85 28 fe ff ff mov -0x1d8(%rbp),%rax a: 49 8d 5d 04 lea 0x4(%r13),%rbx e: 48 c1 e8 0c shr $0xc,%rax 12: 48 89 da mov %rbx,%rdx 15: 48 c1 ea 03 shr $0x3,%rdx 19: 48 89 85 30 fe ff ff mov %rax,-0x1d0(%rbp) 20: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 27: fc ff df * 2a: 0f b6 14 02 movzbl (%rdx,%rax,1),%edx <-- trapping instruction 2e: 48 89 d8 mov %rbx,%rax 31: 83 e0 07 and $0x7,%eax 34: 83 c0 03 add $0x3,%eax 37: 38 d0 cmp %dl,%al 39: 7c 08 jl 0x43 3b: 84 d2 test %dl,%dl 3d: 0f .byte 0xf 3e: 85 .byte 0x85 3f: a3 .byte 0xa3