================================================================== 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+0x99c/0x9f0 net/ipv4/tcp_timer.c:594 Read of size 1 at addr ffff88801d183fc5 by task kworker/u4:1/11 CPU: 0 PID: 11 Comm: kworker/u4:1 Not tainted 6.1.0-rc8-syzkaller-00165-ge095493091e8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: bat_events batadv_nc_worker Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 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+0xbf/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+0x99c/0x9f0 net/ipv4/tcp_timer.c:594 tcp_write_timer+0xa6/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+0xb7/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x9/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x97/0xc0 arch/x86/kernel/apic/apic.c:1107 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:write_comp_data+0x7/0x90 kernel/kcov.c:230 Code: 81 e2 00 01 ff 00 75 10 65 48 8b 04 25 c0 7f 02 00 48 8b 80 80 15 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 65 8b 05 19 66 82 7e <49> 89 f1 89 c6 49 89 d2 81 e6 00 01 00 00 49 89 f8 65 48 8b 14 25 RSP: 0018:ffffc90000107c80 EFLAGS: 00000246 RAX: 0000000080000000 RBX: 0000000000000400 RCX: ffffffff897c8955 RDX: 0000000000000400 RSI: 00000000000000c0 RDI: 0000000000000004 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: 0000000000000002 R13: 0000000000000000 R14: dffffc0000000000 R15: 00000000000000c0 batadv_nc_purge_orig_hash net/batman-adv/network-coding.c:405 [inline] batadv_nc_worker+0x8a5/0xfa0 net/batman-adv/network-coding.c:719 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:306 Allocated by task 3665: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x82/0x90 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slab.h:737 [inline] slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x2b4/0x3d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:679 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0x129/0x760 net/core/net_namespace.c:465 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x449/0x920 kernel/fork.c:3188 __do_sys_unshare kernel/fork.c:3259 [inline] __se_sys_unshare kernel/fork.c:3257 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3257 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x22/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+0x156/0x1d0 kernel/time/timer.c:1805 __do_softirq+0x1fb/0xadc kernel/softirq.c:571 The buggy address belongs to the object at ffff88801d183880 which belongs to the cache net_namespace of size 6976 The buggy address is located 1861 bytes inside of 6976-byte region [ffff88801d183880, ffff88801d1853c0) The buggy address belongs to the physical page: page:ffffea0000746000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d180 head:ffffea0000746000 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff88807f2b7e41 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff8880121e1500 raw: 0000000000000000 0000000080040004 00000001ffffffff ffff88807f2b7e41 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 3648, tgid 3648 (syz-executor.3), ts 73733839041, free_ts 73729398566 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4291 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5558 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1794 [inline] allocate_slab+0x25f/0x350 mm/slub.c:1939 new_slab mm/slub.c:1992 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3180 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc+0x31a/0x3d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:679 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0x129/0x760 net/core/net_namespace.c:465 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xc5/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x449/0x920 kernel/fork.c:3188 __do_sys_unshare kernel/fork.c:3259 [inline] __se_sys_unshare kernel/fork.c:3257 [inline] __x64_sys_unshare+0x31/0x40 kernel/fork.c:3257 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/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:1459 [inline] free_pcp_prepare+0x65c/0xd90 mm/page_alloc.c:1509 free_unref_page_prepare mm/page_alloc.c:3387 [inline] free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3483 skb_free_head+0xac/0x110 net/core/skbuff.c:760 skb_release_data+0x5f1/0x870 net/core/skbuff.c:789 skb_release_all net/core/skbuff.c:854 [inline] __kfree_skb net/core/skbuff.c:868 [inline] consume_skb net/core/skbuff.c:1033 [inline] consume_skb+0xc6/0x160 net/core/skbuff.c:1027 netlink_recvmsg+0x59c/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+0xf4/0x1c0 net/socket.c:2773 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff88801d183e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801d183f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801d183f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801d184000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801d184080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 81 e2 00 01 ff 00 and $0xff0100,%edx 6: 75 10 jne 0x18 8: 65 48 8b 04 25 c0 7f mov %gs:0x27fc0,%rax f: 02 00 11: 48 8b 80 80 15 00 00 mov 0x1580(%rax),%rax 18: c3 retq 19: 66 2e 0f 1f 84 00 00 nopw %cs:0x0(%rax,%rax,1) 20: 00 00 00 23: 65 8b 05 19 66 82 7e mov %gs:0x7e826619(%rip),%eax # 0x7e826643 * 2a: 49 89 f1 mov %rsi,%r9 <-- trapping instruction 2d: 89 c6 mov %eax,%esi 2f: 49 89 d2 mov %rdx,%r10 32: 81 e6 00 01 00 00 and $0x100,%esi 38: 49 89 f8 mov %rdi,%r8 3b: 65 gs 3c: 48 rex.W 3d: 8b .byte 0x8b 3e: 14 25 adc $0x25,%al