================================================================== BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3213 [inline] BUG: KASAN: double-free or invalid-free in kfree+0xe4/0x540 mm/slub.c:4267 CPU: 0 PID: 19428 Comm: kworker/0:9 Not tainted 5.14.0-rc6-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: events_power_efficient wg_ratelimiter_gc_entries Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:105 print_address_description.constprop.0.cold+0x6c/0x309 mm/kasan/report.c:233 kasan_report_invalid_free+0x51/0x80 mm/kasan/report.c:358 ____kasan_slab_free mm/kasan/common.c:346 [inline] __kasan_slab_free+0x120/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1628 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1653 slab_free mm/slub.c:3213 [inline] kfree+0xe4/0x540 mm/slub.c:4267 bdev_free_inode+0xe0/0x110 fs/block_dev.c:816 i_callback+0x3f/0x70 fs/inode.c:222 rcu_do_batch kernel/rcu/tree.c:2550 [inline] rcu_core+0x7ab/0x1380 kernel/rcu/tree.c:2785 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x16e/0x1c0 kernel/softirq.c:636 irq_exit_rcu+0x5/0x20 kernel/softirq.c:648 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1100 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:lock_release+0x16/0x720 kernel/locking/lockdep.c:5633 Code: 6c 8d e8 8d c1 60 00 e9 6d fd ff ff 0f 1f 84 00 00 00 00 00 48 b8 00 00 00 00 00 fc ff df 41 57 41 56 41 55 41 54 49 89 fc 55 <53> 48 81 ec 90 00 00 00 48 8d 6c 24 10 48 89 74 24 08 48 c7 44 24 RSP: 0018:ffffc900090a7ca0 EFLAGS: 00000286 RAX: dffffc0000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888020af0000 RSI: ffffffff84c1c244 RDI: ffffffff8c608e78 RBP: ffffffff8c608e60 R08: 0000000000000001 R09: 0000000000000003 R10: fffff52001214f8e R11: 0000000000000000 R12: ffffffff8c608e78 R13: 000000da8a424e00 R14: ffff888026eb5100 R15: 0000000000001a9b __raw_spin_unlock include/linux/spinlock_api_smp.h:150 [inline] _raw_spin_unlock+0x12/0x40 kernel/locking/spinlock.c:183 spin_unlock include/linux/spinlock.h:394 [inline] wg_ratelimiter_gc_entries+0x2d4/0x430 drivers/net/wireguard/ratelimiter.c:76 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 2438: 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:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0x9b/0xd0 mm/kasan/common.c:522 kmalloc_node include/linux/slab.h:609 [inline] kzalloc_node include/linux/slab.h:732 [inline] __alloc_disk_node+0x4e/0x380 block/genhd.c:1246 __blk_mq_alloc_disk+0xec/0x190 block/blk-mq.c:3147 loop_add+0x324/0x8c0 drivers/block/loop.c:2345 loop_control_ioctl+0x130/0x450 drivers/block/loop.c:2492 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:1167 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Freed by task 2438: 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:360 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xfb/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1628 [inline] slab_free_freelist_hook+0xdf/0x240 mm/slub.c:1653 slab_free mm/slub.c:3213 [inline] kfree+0xe4/0x540 mm/slub.c:4267 __alloc_disk_node+0x2e8/0x380 block/genhd.c:1271 __blk_mq_alloc_disk+0xec/0x190 block/blk-mq.c:3147 loop_add+0x324/0x8c0 drivers/block/loop.c:2345 loop_control_ioctl+0x130/0x450 drivers/block/loop.c:2492 __do_compat_sys_ioctl+0x1c7/0x290 fs/ioctl.c:1167 do_syscall_32_irqs_on arch/x86/entry/common.c:112 [inline] __do_fast_syscall_32+0x65/0xf0 arch/x86/entry/common.c:178 do_fast_syscall_32+0x2f/0x70 arch/x86/entry/common.c:203 entry_SYSENTER_compat_after_hwframe+0x4d/0x5c Last potentially related work creation: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_record_aux_stack+0xe5/0x110 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3594 drop_sysctl_table+0x3c0/0x4e0 fs/proc/proc_sysctl.c:1647 unregister_sysctl_table fs/proc/proc_sysctl.c:1685 [inline] unregister_sysctl_table+0xc2/0x190 fs/proc/proc_sysctl.c:1660 neigh_sysctl_unregister+0x5b/0x80 net/core/neighbour.c:3719 addrconf_ifdown.isra.0+0xf8f/0x15b0 net/ipv6/addrconf.c:3849 addrconf_notify+0x606/0x2400 net/ipv6/addrconf.c:3631 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:2123 call_netdevice_notifiers_extack net/core/dev.c:2135 [inline] call_netdevice_notifiers net/core/dev.c:2149 [inline] unregister_netdevice_many+0x951/0x1790 net/core/dev.c:11093 vti6_exit_batch_net+0x3a0/0x670 net/ipv6/ip6_vti.c:1187 ops_exit_list+0x10d/0x160 net/core/net_namespace.c:178 cleanup_net+0x4ea/0xb10 net/core/net_namespace.c:595 process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 kthread+0x3e5/0x4d0 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888020484800 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 0 bytes inside of 512-byte region [ffff888020484800, ffff888020484a00) The buggy address belongs to the page: page:ffffea0000812100 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x20484 head:ffffea0000812100 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 0000000b00000001 ffff888010841c80 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 19, ts 79951018478, free_ts 18737701398 prep_new_page mm/page_alloc.c:2436 [inline] get_page_from_freelist+0xa72/0x2f80 mm/page_alloc.c:4169 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5391 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2244 alloc_slab_page mm/slub.c:1691 [inline] allocate_slab+0x32e/0x4b0 mm/slub.c:1831 new_slab mm/slub.c:1894 [inline] new_slab_objects mm/slub.c:2640 [inline] ___slab_alloc+0x4ba/0x820 mm/slub.c:2803 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2843 slab_alloc_node mm/slub.c:2925 [inline] __kmalloc_node_track_caller+0x2e3/0x360 mm/slub.c:4653 kmalloc_reserve net/core/skbuff.c:355 [inline] __alloc_skb+0xde/0x340 net/core/skbuff.c:426 __napi_alloc_skb+0x70/0x310 net/core/skbuff.c:567 napi_alloc_skb include/linux/skbuff.h:2929 [inline] page_to_skb+0x1b3/0xc60 drivers/net/virtio_net.c:442 receive_mergeable drivers/net/virtio_net.c:1031 [inline] receive_buf+0x338e/0x6380 drivers/net/virtio_net.c:1141 virtnet_receive drivers/net/virtio_net.c:1433 [inline] virtnet_poll+0x5bf/0x11c0 drivers/net/virtio_net.c:1542 __napi_poll+0xaf/0x440 net/core/dev.c:7047 napi_poll net/core/dev.c:7114 [inline] net_rx_action+0x801/0xb40 net/core/dev.c:7201 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 run_ksoftirqd kernel/softirq.c:920 [inline] run_ksoftirqd+0x2d/0x60 kernel/softirq.c:912 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1346 [inline] free_pcp_prepare+0x2c5/0x780 mm/page_alloc.c:1397 free_unref_page_prepare mm/page_alloc.c:3332 [inline] free_unref_page+0x19/0x690 mm/page_alloc.c:3411 unfreeze_partials+0x17c/0x1d0 mm/slub.c:2421 put_cpu_partial+0x13d/0x230 mm/slub.c:2457 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x8e/0xa0 mm/kasan/common.c:444 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook mm/slab.h:519 [inline] slab_alloc_node mm/slub.c:2959 [inline] slab_alloc mm/slub.c:2967 [inline] kmem_cache_alloc+0x285/0x4a0 mm/slub.c:2972 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags include/linux/audit.h:319 [inline] getname+0x8e/0xd0 fs/namei.c:209 do_sys_openat2+0xf5/0x420 fs/open.c:1198 do_sys_open fs/open.c:1220 [inline] __do_sys_open fs/open.c:1228 [inline] __se_sys_open fs/open.c:1224 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1224 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff888020484700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888020484780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888020484800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888020484880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888020484900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== vkms_vblank_simulate: vblank timer overrun ---------------- Code disassembly (best guess), 2 bytes skipped: 0: e8 8d c1 60 00 callq 0x60c192 5: e9 6d fd ff ff jmpq 0xfffffd77 a: 0f 1f 84 00 00 00 00 nopl 0x0(%rax,%rax,1) 11: 00 12: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 19: fc ff df 1c: 41 57 push %r15 1e: 41 56 push %r14 20: 41 55 push %r13 22: 41 54 push %r12 24: 49 89 fc mov %rdi,%r12 27: 55 push %rbp 28: 53 push %rbx <-- trapping instruction 29: 48 81 ec 90 00 00 00 sub $0x90,%rsp 30: 48 8d 6c 24 10 lea 0x10(%rsp),%rbp 35: 48 89 74 24 08 mov %rsi,0x8(%rsp) 3a: 48 rex.W 3b: c7 .byte 0xc7 3c: 44 rex.R 3d: 24 .byte 0x24