================================================================== BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:383 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0xac4/0xb00 net/ipv4/tcp_timer.c:626 Read of size 1 at addr ffff88802b2653d1 by task syz-executor.4/7415 CPU: 0 PID: 7415 Comm: syz-executor.4 Not tainted 5.12.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x141/0x1d7 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2f8 mm/kasan/report.c:233 __kasan_report mm/kasan/report.c:419 [inline] kasan_report.cold+0x7c/0xd8 mm/kasan/report.c:436 tcp_probe_timer net/ipv4/tcp_timer.c:383 [inline] tcp_write_timer_handler+0xac4/0xb00 net/ipv4/tcp_timer.c:626 tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:642 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1431 expire_timers kernel/time/timer.c:1476 [inline] __run_timers.part.0+0x67c/0xa50 kernel/time/timer.c:1745 __run_timers kernel/time/timer.c:1726 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1758 __do_softirq+0x29b/0x9f6 kernel/softirq.c:559 do_softirq.part.0+0xd9/0x130 kernel/softirq.c:460 do_softirq kernel/softirq.c:452 [inline] __local_bh_enable_ip+0x102/0x120 kernel/softirq.c:384 local_bh_enable include/linux/bottom_half.h:32 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:746 [inline] __dev_queue_xmit+0x1ae6/0x2e30 net/core/dev.c:4272 __bpf_tx_skb net/core/filter.c:2113 [inline] __bpf_redirect_no_mac net/core/filter.c:2138 [inline] __bpf_redirect+0x548/0xc80 net/core/filter.c:2161 ____bpf_clone_redirect net/core/filter.c:2445 [inline] bpf_clone_redirect+0x2ae/0x420 net/core/filter.c:2417 bpf_prog_24310864cecaea99+0x56/0x6c bpf_dispatcher_nop_func include/linux/bpf.h:684 [inline] bpf_test_run+0x45f/0xaa0 net/bpf/test_run.c:117 bpf_prog_test_run_skb+0xabc/0x1c70 net/bpf/test_run.c:656 bpf_prog_test_run kernel/bpf/syscall.c:3150 [inline] __do_sys_bpf+0x218b/0x4f40 kernel/bpf/syscall.c:4429 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x4665d9 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:00007f2343816188 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 000000000056c038 RCX: 00000000004665d9 RDX: 0000000000000028 RSI: 0000000020000080 RDI: 000000000000000a RBP: 00000000004bfcb9 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 000000000056c038 R13: 00007fff0250ff1f R14: 00007f2343816300 R15: 0000000000022000 Allocated by task 30594: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:428 [inline] __kasan_slab_alloc+0x84/0xa0 mm/kasan/common.c:461 kasan_slab_alloc include/linux/kasan.h:236 [inline] slab_post_alloc_hook mm/slab.h:524 [inline] slab_alloc_node mm/slub.c:2912 [inline] slab_alloc mm/slub.c:2920 [inline] kmem_cache_alloc+0x219/0x3a0 mm/slub.c:2925 kmem_cache_zalloc include/linux/slab.h:676 [inline] net_alloc net/core/net_namespace.c:409 [inline] copy_net_ns+0x12a/0x760 net/core/net_namespace.c:461 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x8e0 kernel/fork.c:2996 __do_sys_unshare kernel/fork.c:3064 [inline] __se_sys_unshare kernel/fork.c:3062 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3062 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88802b264d40 which belongs to the cache net_namespace of size 6336 The buggy address is located 1681 bytes inside of 6336-byte region [ffff88802b264d40, ffff88802b266600) The buggy address belongs to the page: page:ffffea0000ac9800 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88802b264d40 pfn:0x2b260 head:ffffea0000ac9800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 dead000000000100 dead000000000122 ffff888143988000 raw: ffff88802b264d40 0000000080040003 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 8471, ts 157795475608, free_ts 157779444331 prep_new_page mm/page_alloc.c:2358 [inline] get_page_from_freelist+0x1033/0x2b60 mm/page_alloc.c:3994 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5200 alloc_pages+0x18c/0x2a0 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1644 [inline] allocate_slab+0x2c5/0x4c0 mm/slub.c:1784 new_slab mm/slub.c:1847 [inline] new_slab_objects mm/slub.c:2593 [inline] ___slab_alloc+0x44c/0x7a0 mm/slub.c:2756 __slab_alloc.constprop.0+0xa7/0xf0 mm/slub.c:2796 slab_alloc_node mm/slub.c:2878 [inline] slab_alloc mm/slub.c:2920 [inline] kmem_cache_alloc+0x34b/0x3a0 mm/slub.c:2925 kmem_cache_zalloc include/linux/slab.h:676 [inline] net_alloc net/core/net_namespace.c:409 [inline] copy_net_ns+0x12a/0x760 net/core/net_namespace.c:461 create_new_namespaces+0x3f6/0xb20 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0xbd/0x1f0 kernel/nsproxy.c:226 ksys_unshare+0x445/0x8e0 kernel/fork.c:2996 __do_sys_unshare kernel/fork.c:3064 [inline] __se_sys_unshare kernel/fork.c:3062 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3062 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1298 [inline] __free_pages_ok+0x476/0xce0 mm/page_alloc.c:1572 unfreeze_partials+0x16c/0x1b0 mm/slub.c:2374 put_cpu_partial+0x13d/0x230 mm/slub.c:2410 qlink_free mm/kasan/quarantine.c:146 [inline] qlist_free_all+0x5a/0xc0 mm/kasan/quarantine.c:165 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x8e/0xa0 mm/kasan/common.c:438 kasan_slab_alloc include/linux/kasan.h:236 [inline] slab_post_alloc_hook mm/slab.h:524 [inline] slab_alloc_node mm/slub.c:2912 [inline] slab_alloc mm/slub.c:2920 [inline] kmem_cache_alloc+0x219/0x3a0 mm/slub.c:2925 getname_flags.part.0+0x50/0x4f0 fs/namei.c:138 getname_flags include/linux/audit.h:319 [inline] getname+0x8e/0xd0 fs/namei.c:209 do_sys_openat2+0xf5/0x420 fs/open.c:1181 do_sys_open fs/open.c:1203 [inline] __do_sys_open fs/open.c:1211 [inline] __se_sys_open fs/open.c:1207 [inline] __x64_sys_open+0x119/0x1c0 fs/open.c:1207 do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47 entry_SYSCALL_64_after_hwframe+0x44/0xae Memory state around the buggy address: ffff88802b265280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802b265300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88802b265380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88802b265400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88802b265480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================