================================================================== BUG: KASAN: double-free or invalid-free in bdev_free_inode+0x57/0x80 fs/block_dev.c:787 CPU: 1 PID: 14200 Comm: syz-executor.2 Not tainted 5.11.0-rc1-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2c6 mm/kasan/report.c:230 kasan_report_invalid_free+0x51/0x80 mm/kasan/report.c:355 ____kasan_slab_free+0xcc/0xe0 mm/kasan/common.c:341 kasan_slab_free include/linux/kasan.h:188 [inline] __cache_free mm/slab.c:3424 [inline] kfree+0xed/0x270 mm/slab.c:3760 bdev_free_inode+0x57/0x80 fs/block_dev.c:787 i_callback+0x3f/0x70 fs/inode.c:222 rcu_do_batch kernel/rcu/tree.c:2489 [inline] rcu_core+0x5eb/0xf00 kernel/rcu/tree.c:2723 __do_softirq+0x2a5/0x9f7 kernel/softirq.c:343 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:226 [inline] __irq_exit_rcu kernel/softirq.c:420 [inline] irq_exit_rcu+0x134/0x200 kernel/softirq.c:432 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 RIP: 0010:lock_is_held_type+0xc2/0x100 kernel/locking/lockdep.c:5481 Code: 03 44 39 f0 41 0f 94 c4 48 c7 c7 80 a1 4b 89 e8 44 0b 00 00 b8 ff ff ff ff 65 0f c1 05 47 57 15 77 83 f8 01 75 23 ff 34 24 9d <48> 83 c4 08 44 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 45 31 e4 eb RSP: 0018:ffffc9001579f680 EFLAGS: 00000202 RAX: 0000000000000001 RBX: 0000000000000002 RCX: 1ffffffff19df573 RDX: 0000000000000000 RSI: 0000000000000002 RDI: 0000000000000000 RBP: ffffffff8b3637a0 R08: 0000000000000000 R09: ffffffff8cef79cf R10: fffffbfff19def39 R11: 0000000000000000 R12: 0000000000000000 R13: ffff888079be6b88 R14: 00000000ffffffff R15: ffff888079be6bb0 lock_is_held include/linux/lockdep.h:271 [inline] rcu_read_lock_sched_held+0x3a/0x70 kernel/rcu/update.c:123 trace_lock_release include/trace/events/lock.h:58 [inline] lock_release+0x5b7/0x710 kernel/locking/lockdep.c:5448 zap_pte_range mm/memory.c:1264 [inline] zap_pmd_range mm/memory.c:1368 [inline] zap_pud_range mm/memory.c:1397 [inline] zap_p4d_range mm/memory.c:1418 [inline] unmap_page_range+0xe30/0x2640 mm/memory.c:1439 unmap_single_vma+0x198/0x300 mm/memory.c:1484 unmap_vmas+0x168/0x2e0 mm/memory.c:1516 exit_mmap+0x2b1/0x5a0 mm/mmap.c:3220 __mmput+0x122/0x470 kernel/fork.c:1083 mmput+0x53/0x60 kernel/fork.c:1104 exit_mm kernel/exit.c:501 [inline] do_exit+0xb6a/0x2ae0 kernel/exit.c:812 do_group_exit+0x125/0x310 kernel/exit.c:922 get_signal+0x3ec/0x2010 kernel/signal.c:2770 arch_do_signal_or_restart+0x2a8/0x1eb0 arch/x86/kernel/signal.c:811 handle_signal_work kernel/entry/common.c:147 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x148/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:302 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x45e219 Code: Unable to access opcode bytes at RIP 0x45e1ef. RSP: 002b:00007f8dc3d38cf8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000001 RBX: 000000000119bf88 RCX: 000000000045e219 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 000000000119bf8c RBP: 000000000119bf80 R08: 000000000000000e R09: 0000000000000000 R10: 0000000000000003 R11: 0000000000000246 R12: 000000000119bf8c R13: 00007ffe6763981f R14: 00007f8dc3d399c0 R15: 000000000119bf8c Allocated by task 4890: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:401 [inline] ____kasan_kmalloc.constprop.0+0x7f/0xa0 mm/kasan/common.c:429 kasan_kmalloc include/linux/kasan.h:215 [inline] kmem_cache_alloc_trace+0x1e0/0x400 mm/slab.c:3554 kmalloc include/linux/slab.h:552 [inline] kernfs_get_open_node fs/kernfs/file.c:571 [inline] kernfs_fop_open+0x957/0xd40 fs/kernfs/file.c:717 do_dentry_open+0x4b9/0x11b0 fs/open.c:817 do_open fs/namei.c:3254 [inline] path_openat+0x1b9a/0x2730 fs/namei.c:3371 do_filp_open+0x17e/0x3c0 fs/namei.c:3398 do_sys_openat2+0x16d/0x420 fs/open.c:1172 do_sys_open fs/open.c:1188 [inline] __do_sys_open fs/open.c:1196 [inline] __se_sys_open fs/open.c:1192 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1192 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 4890: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356 ____kasan_slab_free+0xb0/0xe0 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:188 [inline] __cache_free mm/slab.c:3424 [inline] kfree+0xed/0x270 mm/slab.c:3760 kernfs_fop_release+0xe3/0x190 fs/kernfs/file.c:779 __fput+0x283/0x920 fs/file_table.c:280 task_work_run+0xdd/0x190 kernel/task_work.c:140 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop kernel/entry/common.c:174 [inline] exit_to_user_mode_prepare+0x249/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] syscall_exit_to_user_mode+0x19/0x50 kernel/entry/common.c:302 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff888022c80a00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes inside of 128-byte region [ffff888022c80a00, ffff888022c80a80) The buggy address belongs to the page: page:000000003719c165 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888022c80500 pfn:0x22c80 flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000639c88 ffffea0000890e48 ffff888010040400 raw: ffff888022c80500 ffff888022c80000 000000010000000d 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888022c80900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888022c80980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888022c80a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888022c80a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888022c80b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================