================================================================== BUG: KASAN: use-after-free in inet_twsk_kill+0x358/0x3c0 net/ipv4/inet_timewait_sock.c:46 Read of size 8 at addr ffff888040c22dc0 by task kworker/u4:10/3696 CPU: 1 PID: 3696 Comm: kworker/u4:10 Not tainted 5.17.0-rc1-next-20220127 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Workqueue: phy6 ieee80211_iface_work Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x8b/0xb3 lib/dump_stack.c:106 print_address_description.constprop.0+0x1f/0x190 mm/kasan/report.c:255 __kasan_report mm/kasan/report.c:442 [inline] kasan_report.cold+0x7f/0x11b mm/kasan/report.c:459 inet_twsk_kill+0x358/0x3c0 net/ipv4/inet_timewait_sock.c:46 call_timer_fn+0x182/0x600 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x666/0xa00 kernel/time/timer.c:1734 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xae/0x1a0 kernel/time/timer.c:1747 __do_softirq+0x270/0x8c7 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x113/0x170 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x8e/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:638 RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:152 [inline] RIP: 0010:_raw_spin_unlock_irqrestore+0x2e/0x50 kernel/locking/spinlock.c:194 Code: 48 83 c7 18 53 48 89 f3 48 8b 74 24 10 e8 3a d8 1e fd 48 89 ef e8 a2 53 1f fd 80 e7 02 74 06 e8 b8 fa 3f fd fb bf 01 00 00 00 7d 0f 15 fd 65 8b 05 a6 5e f8 7b 85 c0 74 03 5b 5d c3 0f 1f 44 RSP: 0018:ffff88800e16fbe8 EFLAGS: 00000206 RAX: 000000000003a70f RBX: 0000000000000246 RCX: 1ffffffff0d4b17e RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffffffff852bacc0 R08: 0000000000000001 R09: ffffffff86a148b7 R10: fffffbfff0d42916 R11: 0000000000000001 R12: ffff88800ed71950 R13: ffff88800d4903a8 R14: ffffffff83290f2f R15: ffff8880415b14f0 find_and_remove_object+0xe4/0x120 mm/kmemleak.c:560 delete_object_full mm/kmemleak.c:693 [inline] kmemleak_free+0x1f/0x30 mm/kmemleak.c:970 kmemleak_free_recursive include/linux/kmemleak.h:49 [inline] slab_free_hook mm/slub.c:1698 [inline] slab_free_freelist_hook mm/slub.c:1754 [inline] slab_free mm/slub.c:3509 [inline] kmem_cache_free+0x28a/0x420 mm/slub.c:3526 kfree_skbmem+0xef/0x1b0 net/core/skbuff.c:700 __kfree_skb net/core/skbuff.c:757 [inline] kfree_skb_reason net/core/skbuff.c:776 [inline] kfree_skb_reason+0x127/0x3b0 net/core/skbuff.c:770 kfree_skb include/linux/skbuff.h:1115 [inline] ieee80211_iface_work+0x40f/0xcd0 net/mac80211/iface.c:1583 process_one_work+0xa14/0x1690 kernel/workqueue.c:2289 worker_thread+0x637/0x1260 kernel/workqueue.c:2436 kthread+0x2f0/0x3a0 kernel/kthread.c:377 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 297: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:260 [inline] slab_post_alloc_hook mm/slab.h:732 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc+0x1aa/0x480 mm/slub.c:3243 kmem_cache_zalloc include/linux/slab.h:705 [inline] net_alloc net/core/net_namespace.c:407 [inline] copy_net_ns+0x125/0x760 net/core/net_namespace.c:462 create_new_namespaces+0x3f6/0xb30 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x8d0 kernel/fork.c:3048 __do_sys_unshare kernel/fork.c:3119 [inline] __se_sys_unshare kernel/fork.c:3117 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3117 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 3696: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0x108/0x170 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:236 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook mm/slub.c:1754 [inline] slab_free mm/slub.c:3509 [inline] kmem_cache_free+0xe0/0x420 mm/slub.c:3526 net_free net/core/net_namespace.c:436 [inline] net_free net/core/net_namespace.c:432 [inline] cleanup_net+0x7f0/0x9e0 net/core/net_namespace.c:619 process_one_work+0xa14/0x1690 kernel/workqueue.c:2289 worker_thread+0x637/0x1260 kernel/workqueue.c:2436 kthread+0x2f0/0x3a0 kernel/kthread.c:377 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff888040c22980 which belongs to the cache net_namespace of size 5056 The buggy address is located 1088 bytes inside of 5056-byte region [ffff888040c22980, ffff888040c23d40) The buggy address belongs to the page: page:000000007e428432 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888040c20000 pfn:0x40c20 head:000000007e428432 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff8880151a1481 flags: 0x100000000010200(slab|head|node=0|zone=1) raw: 0100000000010200 0000000000000000 dead000000000122 ffff88800805d640 raw: ffff888040c20000 0000000080060005 00000001ffffffff ffff8880151a1481 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888040c22c80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888040c22d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888040c22d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888040c22e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888040c22e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== Bluetooth: hci2: command 0x0406 tx timeout Bluetooth: hci3: command 0x0406 tx timeout Bluetooth: hci1: command 0x0406 tx timeout Bluetooth: hci6: command 0x0406 tx timeout Bluetooth: hci5: command 0x0406 tx timeout Bluetooth: hci7: command 0x0406 tx timeout loop1: detected capacity change from 0 to 72 EXT4-fs (loop1): bad geometry: first data block 0 is beyond end of filesystem (0) loop0: detected capacity change from 0 to 16383 loop1: detected capacity change from 0 to 72 EXT4-fs (loop1): bad geometry: first data block 0 is beyond end of filesystem (0) audit: type=1326 audit(1643337713.719:10): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=4748 comm="syz-executor.3" exe="/syz-executor.3" sig=31 arch=c000003e syscall=202 compat=0 ip=0x7f8807558b19 code=0x0 ---------------- Code disassembly (best guess): 0: 48 83 c7 18 add $0x18,%rdi 4: 53 push %rbx 5: 48 89 f3 mov %rsi,%rbx 8: 48 8b 74 24 10 mov 0x10(%rsp),%rsi d: e8 3a d8 1e fd callq 0xfd1ed84c 12: 48 89 ef mov %rbp,%rdi 15: e8 a2 53 1f fd callq 0xfd1f53bc 1a: 80 e7 02 and $0x2,%bh 1d: 74 06 je 0x25 1f: e8 b8 fa 3f fd callq 0xfd3ffadc 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 7d 0f 15 fd callq 0xfd150fac <-- trapping instruction 2f: 65 8b 05 a6 5e f8 7b mov %gs:0x7bf85ea6(%rip),%eax # 0x7bf85edc 36: 85 c0 test %eax,%eax 38: 74 03 je 0x3d 3a: 5b pop %rbx 3b: 5d pop %rbp 3c: c3 retq 3d: 0f .byte 0xf 3e: 1f (bad) 3f: 44 rex.R