================================================================== BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:378 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler net/ipv4/tcp_timer.c:624 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0x998/0x9f0 net/ipv4/tcp_timer.c:594 Read of size 1 at addr ffff88807bf58745 by task dhcpcd-run-hook/14852 CPU: 1 PID: 14852 Comm: dhcpcd-run-hook Not tainted 6.0.0-rc6-next-20220923-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/22/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15e/0x45d mm/kasan/report.c:395 kasan_report+0xbb/0x1f0 mm/kasan/report.c:495 tcp_probe_timer net/ipv4/tcp_timer.c:378 [inline] tcp_write_timer_handler net/ipv4/tcp_timer.c:624 [inline] tcp_write_timer_handler+0x998/0x9f0 net/ipv4/tcp_timer.c:594 tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:637 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x6a2/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1f7/0xad8 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:unwind_next_frame+0x359/0x1cc0 arch/x86/kernel/unwind_orc.c:461 Code: 00 00 00 00 00 fc ff df 4c 89 fa 48 c1 ea 03 0f b6 04 02 4c 89 fa 83 e2 07 38 d0 7f 08 84 c0 0f 85 a7 08 00 00 41 0f b6 40 04 0f 0f 85 b5 00 00 00 49 8d 78 05 48 b8 00 00 00 00 00 fc ff df RSP: 0018:ffffc9000319f468 EFLAGS: 00000246 RAX: 0000000000000015 RBX: 0000000000000001 RCX: ffffffff89421623 RDX: 0000000000000006 RSI: ffffffff8ef8329a RDI: ffffffff8e53d534 RBP: ffffc9000319f520 R08: ffffffff8ef8329a R09: ffffc9000319f50c R10: fffff52000633ea6 R11: 000000000008c07e R12: ffffc9000319f50d R13: ffffc9000319f4d8 R14: ffffffff89421623 R15: ffffffff8ef8329e arch_stack_walk+0x7d/0xe0 arch/x86/kernel/stacktrace.c:25 stack_trace_save+0x8c/0xc0 kernel/stacktrace.c:122 kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2a/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1669 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1695 slab_free mm/slub.c:3599 [inline] kmem_cache_free_bulk.part.0+0x205/0x780 mm/slub.c:3717 mt_free_bulk lib/maple_tree.c:163 [inline] mas_destroy+0x394/0x5c0 lib/maple_tree.c:5769 mas_store_prealloc+0xec/0x150 lib/maple_tree.c:5704 __vma_adjust+0x765/0x1a70 mm/mmap.c:810 vma_adjust include/linux/mm.h:2664 [inline] __split_vma+0x295/0x5c0 mm/mmap.c:2239 split_vma+0x9f/0xe0 mm/mmap.c:2272 mprotect_fixup+0x746/0x960 mm/mprotect.c:621 do_mprotect_pkey+0x6fd/0xa70 mm/mprotect.c:790 __do_sys_mprotect mm/mprotect.c:817 [inline] __se_sys_mprotect mm/mprotect.c:814 [inline] __x64_sys_mprotect+0x74/0xb0 mm/mprotect.c:814 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+0x63/0xcd RIP: 0033:0x7f59d9bfd297 Code: 44 00 00 b8 0b 00 00 00 0f 05 48 3d 01 f0 ff ff 73 01 c3 48 8d 0d 21 1f 01 00 f7 d8 89 01 48 83 c8 ff c3 b8 0a 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8d 0d 01 1f 01 00 f7 d8 89 01 48 83 RSP: 002b:00007ffda4c834d8 EFLAGS: 00000206 ORIG_RAX: 000000000000000a RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f59d9bfd297 RDX: 0000000000000000 RSI: 000000000001c000 RDI: 00007f59d991f000 RBP: 00007ffda4c83840 R08: 0000000000000003 R09: 0000000000000000 R10: 0000000000000802 R11: 0000000000000206 R12: 00007ffda4c834e0 R13: 0000000000000000 R14: 0000000000000001 R15: 00007f59d9bdbf00 Allocated by task 3638: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x7e/0x80 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:754 [inline] slab_alloc_node mm/slub.c:3336 [inline] slab_alloc mm/slub.c:3344 [inline] __kmem_cache_alloc_lru mm/slub.c:3351 [inline] kmem_cache_alloc+0x2b7/0x3d0 mm/slub.c:3360 kmem_cache_zalloc include/linux/slab.h:685 [inline] net_alloc net/core/net_namespace.c:404 [inline] copy_net_ns+0x125/0x760 net/core/net_namespace.c:459 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3193 __do_sys_unshare kernel/fork.c:3264 [inline] __se_sys_unshare kernel/fork.c:3262 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3262 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+0x63/0xcd Freed by task 10052: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 kasan_set_track+0x21/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2a/0x40 mm/kasan/generic.c:511 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:200 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1669 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1695 slab_free mm/slub.c:3599 [inline] kmem_cache_free+0xea/0x5b0 mm/slub.c:3621 net_free net/core/net_namespace.c:433 [inline] net_free net/core/net_namespace.c:429 [inline] cleanup_net+0x8ba/0xb00 net/core/net_namespace.c:616 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e4/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x693/0x13b0 kernel/workqueue.c:1517 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0x152/0x1d0 kernel/time/timer.c:1805 __do_softirq+0x1f7/0xad8 kernel/softirq.c:571 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:481 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x693/0x13b0 kernel/workqueue.c:1517 call_timer_fn+0x1da/0x7c0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers.part.0+0x4a3/0xaf0 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0x152/0x1d0 kernel/time/timer.c:1805 __do_softirq+0x1f7/0xad8 kernel/softirq.c:571 The buggy address belongs to the object at ffff88807bf58000 which belongs to the cache net_namespace of size 6976 The buggy address is located 1861 bytes inside of 6976-byte region [ffff88807bf58000, ffff88807bf59b40) The buggy address belongs to the physical page: page:ffffea0001efd600 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x7bf58 head:ffffea0001efd600 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff8880119d4500 dead000000040004 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 3638, tgid 3638 (syz-executor.0), ts 165194481510, free_ts 165193602533 prep_new_page mm/page_alloc.c:2538 [inline] get_page_from_freelist+0x1092/0x2d20 mm/page_alloc.c:4287 __alloc_pages+0x1c7/0x5a0 mm/page_alloc.c:5546 alloc_pages+0x1a6/0x270 mm/mempolicy.c:2280 alloc_slab_page mm/slub.c:1739 [inline] allocate_slab+0x213/0x300 mm/slub.c:1884 new_slab mm/slub.c:1937 [inline] ___slab_alloc+0xac1/0x1430 mm/slub.c:3119 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3217 slab_alloc_node mm/slub.c:3302 [inline] slab_alloc mm/slub.c:3344 [inline] __kmem_cache_alloc_lru mm/slub.c:3351 [inline] kmem_cache_alloc+0x31c/0x3d0 mm/slub.c:3360 kmem_cache_zalloc include/linux/slab.h:685 [inline] net_alloc net/core/net_namespace.c:404 [inline] copy_net_ns+0x125/0x760 net/core/net_namespace.c:459 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc1/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x920 kernel/fork.c:3193 __do_sys_unshare kernel/fork.c:3264 [inline] __se_sys_unshare kernel/fork.c:3262 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3262 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+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1458 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1508 free_unref_page_prepare mm/page_alloc.c:3386 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3482 skb_free_head+0xac/0x110 net/core/skbuff.c:662 skb_release_data+0x5f1/0x870 net/core/skbuff.c:691 skb_release_all net/core/skbuff.c:756 [inline] __kfree_skb net/core/skbuff.c:770 [inline] consume_skb net/core/skbuff.c:935 [inline] consume_skb+0xc2/0x160 net/core/skbuff.c:929 netlink_recvmsg+0x598/0xe50 net/netlink/af_netlink.c:1998 sock_recvmsg_nosec net/socket.c:995 [inline] sock_recvmsg net/socket.c:1013 [inline] sock_recvmsg net/socket.c:1009 [inline] ____sys_recvmsg+0x2c7/0x610 net/socket.c:2701 ___sys_recvmsg+0xf2/0x180 net/socket.c:2743 __sys_recvmsg+0xf0/0x1c0 net/socket.c:2773 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+0x63/0xcd Memory state around the buggy address: ffff88807bf58600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807bf58680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88807bf58700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88807bf58780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88807bf58800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess), 7 bytes skipped: 0: df 4c 89 fa fisttps -0x6(%rcx,%rcx,4) 4: 48 c1 ea 03 shr $0x3,%rdx 8: 0f b6 04 02 movzbl (%rdx,%rax,1),%eax c: 4c 89 fa mov %r15,%rdx f: 83 e2 07 and $0x7,%edx 12: 38 d0 cmp %dl,%al 14: 7f 08 jg 0x1e 16: 84 c0 test %al,%al 18: 0f 85 a7 08 00 00 jne 0x8c5 1e: 41 0f b6 40 04 movzbl 0x4(%r8),%eax * 23: a8 0f test $0xf,%al <-- trapping instruction 25: 0f 85 b5 00 00 00 jne 0xe0 2b: 49 8d 78 05 lea 0x5(%r8),%rdi 2f: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax 36: fc ff df