================================================================== BUG: KASAN: use-after-free in tcp_retransmit_timer+0x3142/0x3640 net/ipv4/tcp_timer.c:499 Read of size 8 at addr ffff888065b32310 by task kworker/u4:2/46 CPU: 0 PID: 46 Comm: kworker/u4:2 Not tainted 5.11.0-rc3-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: krdsd rds_connect_worker Call Trace: __dump_stack lib/dump_stack.c:79 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:120 print_address_description.constprop.0.cold+0x5b/0x2c6 mm/kasan/report.c:230 __kasan_report mm/kasan/report.c:396 [inline] kasan_report.cold+0x79/0xd5 mm/kasan/report.c:413 tcp_retransmit_timer+0x3142/0x3640 net/ipv4/tcp_timer.c:499 tcp_write_timer_handler+0x647/0xaa0 net/ipv4/tcp_timer.c:610 tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:630 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1417 expire_timers kernel/time/timer.c:1462 [inline] __run_timers.part.0+0x67c/0xa50 kernel/time/timer.c:1731 __run_timers kernel/time/timer.c:1712 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1744 __do_softirq+0x2bc/0xa29 kernel/softirq.c:343 asm_call_irq_on_stack+0xf/0x20 __run_on_irqstack arch/x86/include/asm/irq_stack.h:26 [inline] run_on_irqstack_cond arch/x86/include/asm/irq_stack.h:77 [inline] do_softirq_own_stack+0xaa/0xd0 arch/x86/kernel/irq_64.c:77 invoke_softirq kernel/softirq.c:226 [inline] __irq_exit_rcu kernel/softirq.c:420 [inline] irq_exit_rcu+0x134/0x200 kernel/softirq.c:432 sysvec_apic_timer_interrupt+0x4d/0x100 arch/x86/kernel/apic/apic.c:1096 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:628 RIP: 0010:__local_bh_enable_ip+0xa8/0x110 kernel/softirq.c:203 Code: 1d 4d 6f bd 7e 65 8b 05 46 6f bd 7e a9 00 ff ff 00 74 45 bf 01 00 00 00 e8 85 00 09 00 e8 c0 1e 34 00 fb 65 8b 05 28 6f bd 7e <85> c0 74 4a 5b 5d c3 65 8b 05 96 7d bd 7e 85 c0 75 a2 0f 0b eb 9e RSP: 0018:ffffc90000ed79f8 EFLAGS: 00000202 RAX: 0000000080000000 RBX: 00000000fffffe00 RCX: ffffffff815849d7 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffffffff87748a48 R08: 0000000000000001 R09: ffffffff8ed3f82f R10: fffffbfff1da7f05 R11: 0000000000000000 R12: dffffc0000000000 R13: ffff88801a429280 R14: ffff888015bec040 R15: 0000000000000000 spin_unlock_bh include/linux/spinlock.h:399 [inline] inet_csk_find_open_port net/ipv4/inet_connection_sock.c:240 [inline] inet_csk_get_port+0xae8/0x1690 net/ipv4/inet_connection_sock.c:367 __inet_bind+0x796/0xbc0 net/ipv4/af_inet.c:528 inet_bind+0xf0/0x170 net/ipv4/af_inet.c:457 rds_tcp_conn_path_connect+0x532/0x880 net/rds/tcp_connect.c:144 rds_connect_worker+0x1a5/0x2c0 net/rds/threads.c:176 process_one_work+0x98d/0x15f0 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x3b1/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 Allocated by task 8489: 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:401 [inline] ____kasan_kmalloc.constprop.0+0x7f/0xa0 mm/kasan/common.c:429 kasan_slab_alloc include/linux/kasan.h:209 [inline] slab_post_alloc_hook mm/slab.h:512 [inline] slab_alloc mm/slab.c:3315 [inline] kmem_cache_alloc+0x1ab/0x4c0 mm/slab.c:3486 kmem_cache_zalloc include/linux/slab.h:672 [inline] net_alloc net/core/net_namespace.c:418 [inline] copy_net_ns+0x12a/0x760 net/core/net_namespace.c:470 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:2957 __do_sys_unshare kernel/fork.c:3025 [inline] __se_sys_unshare kernel/fork.c:3023 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3023 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 8: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:38 kasan_set_track+0x1c/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:356 ____kasan_slab_free+0xb0/0xe0 mm/kasan/common.c:362 kasan_slab_free include/linux/kasan.h:192 [inline] __cache_free mm/slab.c:3424 [inline] kmem_cache_free+0x58/0x1c0 mm/slab.c:3697 net_free net/core/net_namespace.c:446 [inline] net_drop_ns net/core/net_namespace.c:453 [inline] net_drop_ns net/core/net_namespace.c:449 [inline] cleanup_net+0x8d6/0xb10 net/core/net_namespace.c:623 process_one_work+0x98d/0x15f0 kernel/workqueue.c:2275 worker_thread+0x64c/0x1120 kernel/workqueue.c:2421 kthread+0x3b1/0x4a0 kernel/kthread.c:292 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 The buggy address belongs to the object at ffff888065b320c0 which belongs to the cache net_namespace of size 7360 The buggy address is located 592 bytes inside of 7360-byte region [ffff888065b320c0, ffff888065b33d80) The buggy address belongs to the page: page:00000000964dbae3 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x65b32 head:00000000964dbae3 order:1 compound_mapcount:0 flags: 0xfff00000010200(slab|head) raw: 00fff00000010200 ffffea00018b2288 ffffea0001975808 ffff888011081f00 raw: 0000000000000000 ffff888065b320c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888065b32200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888065b32280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888065b32300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888065b32380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888065b32400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================