R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffebf131b9f R14: 00007f6c24c57300 R15: 0000000000022000 ================================================================== BUG: KASAN: use-after-free in inet_twsk_kill+0x358/0x3c0 net/ipv4/inet_timewait_sock.c:46 Read of size 8 at addr ffff888040d28440 by task syz-executor/9672 CPU: 0 PID: 9672 Comm: syz-executor 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 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:ffff88804a157bc8 EFLAGS: 00000206 RAX: 000000000050842b RBX: 0000000000000246 RCX: 1ffffffff0d4697e RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff888009d80a20 R08: 0000000000000001 R09: ffffffff86a14857 R10: fffffbfff0d4290a R11: 0000000000000001 R12: ffffed10013b014c R13: ffff888007f67160 R14: ffff888009d80a20 R15: 0000000000000246 scan_object mm/kmemleak.c:1368 [inline] scan_gray_list+0x1d5/0x3b0 mm/kmemleak.c:1390 kmemleak_scan+0x56b/0x12c0 mm/kmemleak.c:1498 kmemleak_write+0x56f/0x6a0 mm/kmemleak.c:1835 full_proxy_write+0x11d/0x190 fs/debugfs/file.c:236 vfs_write+0x28a/0xae0 fs/read_write.c:589 ksys_write+0x12d/0x250 fs/read_write.c:644 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 RIP: 0033:0x7f2741e655c3 Code: 16 00 00 00 eb ae 90 b8 6e 00 00 00 eb a6 e8 44 ef 04 00 0f 1f 40 00 64 8b 04 25 18 00 00 00 85 c0 75 14 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 55 c3 0f 1f 40 00 48 83 ec 28 48 89 54 24 18 RSP: 002b:00007ffcf337fa88 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007ffcf33800c8 RCX: 00007f2741e655c3 RDX: 0000000000000004 RSI: 00007f2741f1bed9 RDI: 0000000000000003 RBP: 0000000000000006 R08: 00000000000005c4 R09: 00007ffcf33bd080 R10: 00007ffcf33bd090 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffcf337fb60 R14: 0000000000000000 R15: 0000000000000003 Allocated by task 294: 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 The buggy address belongs to the object at ffff888040d28000 which belongs to the cache net_namespace of size 5056 The buggy address is located 1088 bytes inside of 5056-byte region [ffff888040d28000, ffff888040d293c0) The buggy address belongs to the page: page:0000000079dc473c refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888040d28000 pfn:0x40d28 head:0000000079dc473c order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff88800cb1f201 flags: 0x100000000010200(slab|head|node=0|zone=1) raw: 0100000000010200 0000000000000000 dead000000000001 ffff88800805d640 raw: ffff888040d28000 0000000080060004 00000001ffffffff ffff88800cb1f201 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888040d28300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888040d28380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888040d28400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888040d28480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888040d28500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== audit: type=1326 audit(1643534611.448:52): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=9684 comm="syz-executor.1" exe="/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7ff8e5d90b19 code=0x0 FAULT_INJECTION: forcing a failure. name failslab, interval 1, probability 0, space 0, times 0 CPU: 1 PID: 9682 Comm: syz-executor.3 Tainted: G B 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 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x8b/0xb3 lib/dump_stack.c:106 fail_dump lib/fault-inject.c:52 [inline] should_fail.cold+0x5/0xa lib/fault-inject.c:146 should_failslab+0x5/0x10 mm/slab_common.c:1304 slab_pre_alloc_hook mm/slab.h:707 [inline] slab_alloc_node mm/slub.c:3144 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc+0x5b/0x480 mm/slub.c:3243 mem_pool_alloc mm/kmemleak.c:430 [inline] create_object.isra.0+0x3a/0xa20 mm/kmemleak.c:586 kmemleak_alloc_recursive include/linux/kmemleak.h:43 [inline] slab_post_alloc_hook mm/slab.h:735 [inline] slab_alloc_node mm/slub.c:3230 [inline] slab_alloc mm/slub.c:3238 [inline] kmem_cache_alloc_trace+0x22e/0x3c0 mm/slub.c:3255 kmalloc include/linux/slab.h:581 [inline] genl_dumpit_info_alloc net/netlink/genetlink.c:510 [inline] genl_start+0x1e6/0x670 net/netlink/genetlink.c:583 __netlink_dump_start+0x589/0x900 net/netlink/af_netlink.c:2363 genl_family_rcv_msg_dumpit+0x1c9/0x310 net/netlink/genetlink.c:689 SELinux: Context :' is not valid (left unmapped). genl_family_rcv_msg net/netlink/genetlink.c:772 [inline] genl_rcv_msg+0x447/0x5a0 net/netlink/genetlink.c:792 netlink_rcv_skb+0x14b/0x430 net/netlink/af_netlink.c:2494 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1317 [inline] netlink_unicast+0x540/0x7f0 net/netlink/af_netlink.c:1343 netlink_sendmsg+0x904/0xdf0 net/netlink/af_netlink.c:1919 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0x150/0x190 net/socket.c:725 ____sys_sendmsg+0x709/0x870 net/socket.c:2413 ___sys_sendmsg+0xf3/0x170 net/socket.c:2467 UDC core: couldn't find an available UDC or it's busy: -19 misc raw-gadget: fail, usb_gadget_probe_driver returned -19 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2496 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 RIP: 0033:0x7f6c276e1b19 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f6c24c57188 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f6c277f4f60 RCX: 00007f6c276e1b19 RDX: 0000000000000000 RSI: 0000000020000340 RDI: 0000000000000003 RBP: 00007f6c24c571d0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000001 R13: 00007ffebf131b9f R14: 00007f6c24c57300 R15: 0000000000022000 audit: type=1326 audit(1643534611.498:53): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=9684 comm="syz-executor.1" exe="/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7ff8e5d90b19 code=0x0 audit: type=1326 audit(1643534611.549:54): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=9684 comm="syz-executor.1" exe="/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7ff8e5d90b19 code=0x0 program syz-executor.0 is using a deprecated SCSI ioctl, please convert it to SG_IO program syz-executor.0 is using a deprecated SCSI ioctl, please convert it to SG_IO UDC core: couldn't find an available UDC or it's busy: -19 misc raw-gadget: fail, usb_gadget_probe_driver returned -19 audit: type=1326 audit(1643534612.282:55): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=9684 comm="syz-executor.1" exe="/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7ff8e5d90b19 code=0x0 audit: type=1326 audit(1643534612.283:56): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=9684 comm="syz-executor.1" exe="/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7ff8e5d90b19 code=0x0 audit: type=1326 audit(1643534612.283:57): auid=0 uid=0 gid=0 ses=4 subj=system_u:system_r:kernel_t:s0 pid=9684 comm="syz-executor.1" exe="/syz-executor.1" sig=9 arch=c000003e syscall=231 compat=0 ip=0x7ff8e5d90b19 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