================================================================== BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3157 [inline] BUG: KASAN: double-free or invalid-free in kfree+0xe5/0x5c0 mm/slub.c:4156 CPU: 0 PID: 12345 Comm: systemd-udevd Not tainted 5.10.0-next-20201223-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/0x2f8 mm/kasan/report.c:230 kasan_report_invalid_free+0x51/0x80 mm/kasan/report.c:355 ____kasan_slab_free.part.0+0xfd/0x110 mm/kasan/common.c:344 kasan_slab_free include/linux/kasan.h:188 [inline] slab_free_hook mm/slub.c:1548 [inline] slab_free_freelist_hook+0x82/0x1d0 mm/slub.c:1586 slab_free mm/slub.c:3157 [inline] kfree+0xe5/0x5c0 mm/slub.c:4156 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:check_kcov_mode+0xf/0x40 kernel/kcov.c:163 Code: b7 42 00 e9 a1 fe ff ff 48 8b 3c 24 e8 7a b7 42 00 e9 18 fe ff ff cc cc cc cc cc 65 8b 05 19 7e 8f 7e 89 c2 81 e2 00 01 00 00 00 01 ff 00 74 10 31 c0 85 d2 74 15 8b 96 d4 14 00 00 85 d2 74 RSP: 0018:ffffc9000189fae8 EFLAGS: 00000246 RAX: 0000000080000000 RBX: ffff888014a857a0 RCX: 0000000000000020 RDX: 0000000000000000 RSI: ffff88801b37b800 RDI: 0000000000000003 RBP: 0000000000000021 R08: 0000000000000000 R09: ffffffff8ebe283f R10: ffffffff81c72dd6 R11: 0000000000000000 R12: 0000000000000020 R13: ffff8880206f9878 R14: ffff888014a85748 R15: ffff888014a85748 write_comp_data kernel/kcov.c:218 [inline] __sanitizer_cov_trace_const_cmp8+0x1d/0x70 kernel/kcov.c:291 clear_inode+0x116/0x1e0 fs/inode.c:535 shmem_evict_inode+0x240/0xbc0 mm/shmem.c:1154 evict+0x2ed/0x6b0 fs/inode.c:577 iput_final fs/inode.c:1653 [inline] iput.part.0+0x57e/0x810 fs/inode.c:1679 iput+0x58/0x70 fs/inode.c:1669 dentry_unlink_inode+0x2b1/0x3d0 fs/dcache.c:374 __dentry_kill+0x3c0/0x640 fs/dcache.c:579 dentry_kill fs/dcache.c:717 [inline] dput+0x635/0xbc0 fs/dcache.c:885 do_renameat2+0x469/0xc00 fs/namei.c:4461 __do_sys_rename fs/namei.c:4508 [inline] __se_sys_rename fs/namei.c:4506 [inline] __x64_sys_rename+0x7d/0xa0 fs/namei.c:4506 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7f9cedb40d47 Code: 75 12 48 89 df e8 19 84 07 00 85 c0 0f 95 c0 0f b6 c0 f7 d8 5b c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 00 b8 52 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 21 41 33 00 f7 d8 64 89 01 48 RSP: 002b:00007ffdac72c758 EFLAGS: 00000246 ORIG_RAX: 0000000000000052 RAX: ffffffffffffffda RBX: 0000561b76542720 RCX: 00007f9cedb40d47 RDX: 0000000000000000 RSI: 00007ffdac72c760 RDI: 0000561b76541ea0 RBP: 00007ffdac72c820 R08: 0000561b76557500 R09: 0000561b76557420 R10: 00007f9ceed448c0 R11: 0000000000000246 R12: 00007ffdac72c760 R13: 0000000000000001 R14: 0000561b74d3a6cb R15: 0000000000000000 Allocated by task 11596: 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:404 [inline] ____kasan_kmalloc mm/kasan/common.c:435 [inline] ____kasan_kmalloc.constprop.0+0xa0/0xd0 mm/kasan/common.c:407 kmalloc include/linux/slab.h:557 [inline] tomoyo_add_entry security/tomoyo/common.c:2031 [inline] tomoyo_supervisor+0xce3/0xef0 security/tomoyo/common.c:2103 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x270/0x3a0 security/tomoyo/file.c:573 tomoyo_path_perm+0x39e/0x400 security/tomoyo/file.c:838 tomoyo_path_symlink+0x94/0xe0 security/tomoyo/tomoyo.c:200 security_path_symlink+0xdf/0x150 security/security.c:1111 do_symlinkat+0x123/0x2c0 fs/namei.c:3987 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88801200d700 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 0 bytes inside of 128-byte region [ffff88801200d700, ffff88801200d780) The buggy address belongs to the page: page:00000000c3b32046 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801200d700 pfn:0x1200d flags: 0xfff00000000200(slab) raw: 00fff00000000200 ffffea0000703488 ffffea000069b4c8 ffff888010041640 raw: ffff88801200d700 000000000010000e 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88801200d600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88801200d680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801200d700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801200d780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801200d800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================