================================================================== BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3204 [inline] BUG: KASAN: double-free or invalid-free in kfree+0xd5/0x320 mm/slub.c:4192 CPU: 0 PID: 2277 Comm: syz-executor.1 Tainted: G W 5.10.77-syzkaller-01258-g76698ea35fd3 #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_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x8d/0x3d0 mm/kasan/report.c:233 kasan_report_invalid_free+0x58/0x130 mm/kasan/report.c:358 ____kasan_slab_free+0x14b/0x170 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1596 [inline] slab_free_freelist_hook+0xcc/0x1a0 mm/slub.c:1622 slab_free mm/slub.c:3204 [inline] kfree+0xd5/0x320 mm/slub.c:4192 io_put_identity fs/io_uring.c:1262 [inline] io_req_clean_work fs/io_uring.c:1300 [inline] io_dismantle_req+0x9b0/0xd90 fs/io_uring.c:1896 io_req_free_batch fs/io_uring.c:2202 [inline] io_iopoll_complete fs/io_uring.c:2377 [inline] io_do_iopoll+0x13b4/0x23f0 fs/io_uring.c:2433 io_iopoll_try_reap_events+0x116/0x290 fs/io_uring.c:2472 io_ring_ctx_wait_and_kill+0x295/0x670 fs/io_uring.c:8577 io_uring_release+0x5b/0x70 fs/io_uring.c:8604 __fput+0x348/0x7d0 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x147/0x1b0 kernel/task_work.c:154 exit_task_work include/linux/task_work.h:30 [inline] do_exit+0x70e/0x23a0 kernel/exit.c:813 do_group_exit+0x16a/0x2d0 kernel/exit.c:910 get_signal+0x133e/0x1f80 kernel/signal.c:2790 arch_do_signal+0x8d/0x620 arch/x86/kernel/signal.c:805 exit_to_user_mode_loop kernel/entry/common.c:161 [inline] exit_to_user_mode_prepare+0xaa/0xe0 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x24/0x40 kernel/entry/common.c:266 do_syscall_64+0x3d/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7efdd62d1ae9 Code: Unable to access opcode bytes at RIP 0x7efdd62d1abf. RSP: 002b:00007efdd4048218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007efdd63e4f68 RCX: 00007efdd62d1ae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007efdd63e4f68 RBP: 00007efdd63e4f60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007efdd63e4f6c R13: 00007ffca2fb1f5f R14: 00007efdd4048300 R15: 0000000000022000 Allocated by task 2290: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:428 [inline] ____kasan_kmalloc+0xdc/0x110 mm/kasan/common.c:507 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:516 kasan_kmalloc include/linux/kasan.h:269 [inline] kmem_cache_alloc_trace+0x210/0x3a0 mm/slub.c:2975 kmalloc include/linux/slab.h:552 [inline] io_uring_alloc_task_context+0x57/0x550 fs/io_uring.c:7903 io_uring_add_task_file+0x1f7/0x290 fs/io_uring.c:8781 io_uring_install_fd fs/io_uring.c:9315 [inline] io_uring_create+0x2195/0x3490 fs/io_uring.c:9517 io_uring_setup fs/io_uring.c:9556 [inline] __do_sys_io_uring_setup fs/io_uring.c:9562 [inline] __se_sys_io_uring_setup fs/io_uring.c:9559 [inline] __x64_sys_io_uring_setup+0x1ce/0x290 fs/io_uring.c:9559 do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:345 __call_rcu kernel/rcu/tree.c:2962 [inline] call_rcu+0x134/0x1470 kernel/rcu/tree.c:3036 neigh_parms_release+0x1da/0x210 net/core/neighbour.c:1670 inetdev_destroy net/ipv4/devinet.c:325 [inline] inetdev_event+0x81f/0x11b0 net/ipv4/devinet.c:1599 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8e/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers net/core/dev.c:2080 [inline] rollback_registered_many+0xe2e/0x1620 net/core/dev.c:9553 unregister_netdevice_many+0x4e/0x290 net/core/dev.c:10762 ip_tunnel_delete_nets+0x375/0x3c0 net/ipv4/ip_tunnel.c:1122 vti_exit_batch_net+0x22/0x30 net/ipv4/ip_vti.c:512 ops_exit_list net/core/net_namespace.c:190 [inline] cleanup_net+0x76c/0xd60 net/core/net_namespace.c:604 process_one_work+0x6b4/0xfb0 kernel/workqueue.c:2289 worker_thread+0xb15/0x1600 kernel/workqueue.c:2435 kthread+0x371/0x390 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 The buggy address belongs to the object at ffff88815ffcc700 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 88 bytes inside of 192-byte region [ffff88815ffcc700, ffff88815ffcc7c0) The buggy address belongs to the page: page:ffffea00057ff300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x15ffcc flags: 0x8000000000000200(slab) raw: 8000000000000200 ffffea000438e700 0000000a0000000a ffff888100043380 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x12a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY), pid 379, ts 85071120129, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2385 [inline] prep_new_page mm/page_alloc.c:2391 [inline] get_page_from_freelist+0xa74/0xa90 mm/page_alloc.c:4063 __alloc_pages_nodemask+0x3c8/0x820 mm/page_alloc.c:5106 alloc_slab_page mm/slub.c:1807 [inline] allocate_slab+0x6b/0x350 mm/slub.c:1809 new_slab mm/slub.c:1870 [inline] new_slab_objects mm/slub.c:2629 [inline] ___slab_alloc+0x143/0x2f0 mm/slub.c:2792 __slab_alloc mm/slub.c:2832 [inline] slab_alloc_node mm/slub.c:2914 [inline] slab_alloc mm/slub.c:2956 [inline] kmem_cache_alloc_trace+0x278/0x3a0 mm/slub.c:2973 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] mca_alloc net/ipv6/mcast.c:853 [inline] __ipv6_dev_mc_inc+0x3bb/0xaa0 net/ipv6/mcast.c:911 ipv6_dev_mc_inc+0x1f/0x30 net/ipv6/mcast.c:935 ipv6_add_dev+0xcaf/0x10d0 net/ipv6/addrconf.c:460 addrconf_notify+0x6c3/0x3a80 net/ipv6/addrconf.c:3517 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8e/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers net/core/dev.c:2080 [inline] register_netdevice+0x1502/0x1ad0 net/core/dev.c:10135 veth_newlink+0x864/0xba0 drivers/net/veth.c:1385 __rtnl_newlink net/core/rtnetlink.c:3442 [inline] rtnl_newlink+0x1580/0x1db0 net/core/rtnetlink.c:3501 rtnetlink_rcv_msg+0xbae/0xd70 net/core/rtnetlink.c:5567 netlink_rcv_skb+0x200/0x470 net/netlink/af_netlink.c:2502 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5585 page_owner free stack trace missing Memory state around the buggy address: ffff88815ffcc600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88815ffcc680: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc >ffff88815ffcc700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffff88815ffcc780: 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc fc ffff88815ffcc800: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: underflow; use-after-free. WARNING: CPU: 0 PID: 2277 at lib/refcount.c:28 refcount_warn_saturate+0x165/0x1b0 lib/refcount.c:28 Modules linked in: CPU: 0 PID: 2277 Comm: syz-executor.1 Tainted: G B W 5.10.77-syzkaller-01258-g76698ea35fd3 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:refcount_warn_saturate+0x165/0x1b0 lib/refcount.c:28 Code: c7 60 b0 49 85 31 c0 e8 59 73 eb fe 0f 0b eb 83 e8 e0 90 18 ff c6 05 de c4 68 04 01 48 c7 c7 c0 b0 49 85 31 c0 e8 3b 73 eb fe <0f> 0b e9 62 ff ff ff e8 bf 90 18 ff c6 05 be c4 68 04 01 48 c7 c7 RSP: 0018:ffffc900056af4b0 EFLAGS: 00010246 RAX: c4e1af259ddaae00 RBX: 0000000000000003 RCX: 1ffff92000ad5e50 RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000 RBP: ffffc900056af4c0 R08: ffffffff81545288 R09: fffff52000ad5dc1 R10: fffff52000ad5dc1 R11: 0000000000000000 R12: ffff88815ffcc758 R13: ffff88816a43bd48 R14: 0000000000000003 R15: 00000000ffffffff FS: 0000000000000000(0000) GS:ffff8881f7000000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f36c89ae6cc CR3: 0000000167c44000 CR4: 00000000003526b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: __refcount_sub_and_test include/linux/refcount.h:283 [inline] __refcount_dec_and_test include/linux/refcount.h:315 [inline] refcount_dec_and_test include/linux/refcount.h:333 [inline] io_put_identity fs/io_uring.c:1261 [inline] io_req_clean_work fs/io_uring.c:1300 [inline] io_dismantle_req+0xa72/0xd90 fs/io_uring.c:1896 io_req_free_batch fs/io_uring.c:2202 [inline] io_iopoll_complete fs/io_uring.c:2377 [inline] io_do_iopoll+0x13b4/0x23f0 fs/io_uring.c:2433 io_iopoll_try_reap_events+0x116/0x290 fs/io_uring.c:2472 io_ring_ctx_wait_and_kill+0x295/0x670 fs/io_uring.c:8577 io_uring_release+0x5b/0x70 fs/io_uring.c:8604 __fput+0x348/0x7d0 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x147/0x1b0 kernel/task_work.c:154 exit_task_work include/linux/task_work.h:30 [inline] do_exit+0x70e/0x23a0 kernel/exit.c:813 do_group_exit+0x16a/0x2d0 kernel/exit.c:910 get_signal+0x133e/0x1f80 kernel/signal.c:2790 arch_do_signal+0x8d/0x620 arch/x86/kernel/signal.c:805 exit_to_user_mode_loop kernel/entry/common.c:161 [inline] exit_to_user_mode_prepare+0xaa/0xe0 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x24/0x40 kernel/entry/common.c:266 do_syscall_64+0x3d/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7efdd62d1ae9 Code: Unable to access opcode bytes at RIP 0x7efdd62d1abf. RSP: 002b:00007efdd4048218 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: fffffffffffffe00 RBX: 00007efdd63e4f68 RCX: 00007efdd62d1ae9 RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007efdd63e4f68 RBP: 00007efdd63e4f60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007efdd63e4f6c R13: 00007ffca2fb1f5f R14: 00007efdd4048300 R15: 0000000000022000 ---[ end trace f5781710d887c4e6 ]---