================================================================== BUG: KASAN: use-after-free in tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline] BUG: KASAN: use-after-free in tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652 Read of size 1 at addr ffff8880779ddc05 by task syz-executor.4/21360 CPU: 1 PID: 21360 Comm: syz-executor.4 Not tainted 6.1.82-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 tcp_probe_timer net/ipv4/tcp_timer.c:388 [inline] tcp_write_timer_handler+0x7ef/0x930 net/ipv4/tcp_timer.c:652 tcp_write_timer+0x12e/0x280 net/ipv4/tcp_timer.c:665 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers+0x67c/0x890 kernel/time/timer.c:1790 run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1803 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571 do_softirq+0x162/0x240 kernel/softirq.c:472 __local_bh_enable_ip+0x1b1/0x1f0 kernel/softirq.c:396 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:830 [inline] __dev_queue_xmit+0x1790/0x3cf0 net/core/dev.c:4320 dev_queue_xmit include/linux/netdevice.h:3021 [inline] neigh_hh_output include/net/neighbour.h:528 [inline] neigh_output include/net/neighbour.h:542 [inline] ip_finish_output2+0xcf2/0x1310 net/ipv4/ip_output.c:228 dst_output include/net/dst.h:444 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] __ip_queue_xmit+0x11b1/0x1b60 net/ipv4/ip_output.c:532 __tcp_transmit_skb+0x1e33/0x33a0 net/ipv4/tcp_output.c:1403 tcp_validate_incoming+0x1237/0x28f0 net/ipv4/tcp_input.c:5753 tcp_rcv_established+0xc32/0x1f00 net/ipv4/tcp_input.c:6013 tcp_v4_do_rcv+0x487/0xb00 net/ipv4/tcp_ipv4.c:1677 sk_backlog_rcv include/net/sock.h:1117 [inline] __release_sock+0x198/0x4b0 net/core/sock.c:2935 release_sock+0x5d/0x1c0 net/core/sock.c:3499 sk_stream_wait_memory+0x725/0xef0 net/core/stream.c:145 tcp_sendmsg_locked+0x17f5/0x4100 net/ipv4/tcp.c:1451 tcp_sendmsg+0x2c/0x40 net/ipv4/tcp.c:1489 sock_sendmsg_nosec net/socket.c:718 [inline] __sock_sendmsg net/socket.c:730 [inline] __sys_sendto+0x480/0x600 net/socket.c:2148 __do_sys_sendto net/socket.c:2160 [inline] __se_sys_sendto net/socket.c:2156 [inline] __x64_sys_sendto+0xda/0xf0 net/socket.c:2156 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fabb387dda9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fabb45f30c8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007fabb39abf80 RCX: 00007fabb387dda9 RDX: 00000000fffffea5 RSI: 0000000020000480 RDI: 0000000000000006 RBP: 00007fabb38ca47a R08: 0000000000000000 R09: 00000000fffffcef R10: 000000000000c000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fabb39abf80 R15: 00007ffdcfcdab08 Allocated by task 12664: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x65/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x52/0x3a0 mm/slab.h:737 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+0x10c/0x2d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:682 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465 create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226 ksys_unshare+0x580/0xb20 kernel/fork.c:3203 __do_sys_unshare kernel/fork.c:3274 [inline] __se_sys_unshare kernel/fork.c:3272 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3272 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb0/0xc0 mm/kasan/generic.c:486 insert_work+0x54/0x3d0 kernel/workqueue.c:1361 __queue_work+0xb4b/0xf90 kernel/workqueue.c:1520 call_timer_fn+0x1ad/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1514 [inline] __run_timers+0x6a8/0x890 kernel/time/timer.c:1790 __do_softirq+0x2e9/0xa4c kernel/softirq.c:571 The buggy address belongs to the object at ffff8880779dd4c0 which belongs to the cache net_namespace of size 6976 The buggy address is located 1861 bytes inside of 6976-byte region [ffff8880779dd4c0, ffff8880779df000) The buggy address belongs to the physical page: page:ffffea0001de7600 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880779dd4c0 pfn:0x779d8 head:ffffea0001de7600 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff8880387855c1 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff88801263a500 raw: ffff8880779dd4c0 0000000080040002 00000001ffffffff ffff8880387855c1 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 3568, tgid 3568 (syz-executor.0), ts 97024232071, free_ts 57556429883 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2513 prep_new_page mm/page_alloc.c:2520 [inline] get_page_from_freelist+0x31a1/0x3320 mm/page_alloc.c:4279 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5545 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] 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+0x1a5/0x2d0 mm/slub.c:3422 kmem_cache_zalloc include/linux/slab.h:682 [inline] net_alloc net/core/net_namespace.c:410 [inline] copy_net_ns+0x143/0x5d0 net/core/net_namespace.c:465 create_new_namespaces+0x425/0x7a0 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x11e/0x170 kernel/nsproxy.c:226 ksys_unshare+0x580/0xb20 kernel/fork.c:3203 __do_sys_unshare kernel/fork.c:3274 [inline] __se_sys_unshare kernel/fork.c:3272 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:3272 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 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:1440 [inline] free_pcp_prepare mm/page_alloc.c:1490 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3358 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3453 pipe_buf_release include/linux/pipe_fs_i.h:199 [inline] pipe_read+0x6e1/0x12a0 fs/pipe.c:324 call_read_iter include/linux/fs.h:2259 [inline] new_sync_read fs/read_write.c:389 [inline] vfs_read+0x7de/0xbe0 fs/read_write.c:470 ksys_read+0x19c/0x2c0 fs/read_write.c:613 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x63/0xcd Memory state around the buggy address: ffff8880779ddb00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880779ddb80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880779ddc00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880779ddc80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880779ddd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================