================================================================== BUG: KASAN: use-after-free in tcp_retransmit_timer+0x2ef3/0x3360 net/ipv4/tcp_timer.c:511 Read of size 8 at addr ffff88801fb802c0 by task syz-executor.4/10484 CPU: 0 PID: 10484 Comm: syz-executor.4 Not tainted 5.18.0-rc3-syzkaller-01612-g70a1b25326dd #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 tcp_retransmit_timer+0x2ef3/0x3360 net/ipv4/tcp_timer.c:511 tcp_write_timer_handler+0x5e6/0xbc0 net/ipv4/tcp_timer.c:622 tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:642 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1466 [inline] __run_timers.part.0+0x679/0xa80 kernel/time/timer.c:1737 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1750 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 invoke_softirq kernel/softirq.c:432 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:637 irq_exit_rcu+0x5/0x20 kernel/softirq.c:649 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1097 asm_sysvec_apic_timer_interrupt+0x12/0x20 arch/x86/include/asm/idtentry.h:645 RIP: 0010:switchdev_lower_dev_walk+0x0/0x140 net/switchdev/switchdev.c:392 Code: 54 d3 50 00 5b e9 c0 6d 5c f8 e8 bb 6d 5c f8 48 8b 3d 94 97 7c 07 e9 5f f4 0b fa cc cc cc cc cc cc cc cc cc cc cc cc cc cc cc <41> 56 41 55 41 54 49 89 fc 55 53 48 89 f3 e8 8d 6d 5c f8 48 8d 7b RSP: 0018:ffffc90004b6f548 EFLAGS: 00000212 RAX: ffffffff891cbfc0 RBX: ffff888068cf2000 RCX: ffffc90014ba2000 RDX: 0000000000040000 RSI: ffffc90004b6f728 RDI: ffff888068cf2000 RBP: 0000000000000001 R08: 0000000000000000 R09: 0000000000000001 R10: ffffffff891ce5c4 R11: 0000000000000000 R12: ffff88805a15dfa0 R13: ffff888068cf20b0 R14: 0000000000000000 R15: ffff888068cf2000 netdev_walk_all_lower_dev+0xba/0x340 net/core/dev.c:7111 switchdev_lower_dev_find net/switchdev/switchdev.c:448 [inline] __switchdev_handle_port_obj_del+0x3e4/0x490 net/switchdev/switchdev.c:706 switchdev_handle_port_obj_del_foreign+0x30/0x60 net/switchdev/switchdev.c:751 dsa_slave_switchdev_blocking_event+0x8c/0x120 net/dsa/slave.c:2981 notifier_call_chain+0xb5/0x200 kernel/notifier.c:84 blocking_notifier_call_chain kernel/notifier.c:319 [inline] blocking_notifier_call_chain+0x67/0x90 kernel/notifier.c:307 call_switchdev_blocking_notifiers net/switchdev/switchdev.c:377 [inline] switchdev_port_obj_notify+0xaf/0x160 net/switchdev/switchdev.c:207 switchdev_port_obj_del_now net/switchdev/switchdev.c:266 [inline] switchdev_port_obj_del net/switchdev/switchdev.c:306 [inline] switchdev_port_obj_del+0x87/0x170 net/switchdev/switchdev.c:300 br_switchdev_port_vlan_del+0x9a/0xd0 net/bridge/br_switchdev.c:185 __vlan_vid_del net/bridge/br_vlan.c:152 [inline] __vlan_del+0x6dc/0xa50 net/bridge/br_vlan.c:400 __vlan_flush+0x10d/0x2c0 net/bridge/br_vlan.c:459 nbp_vlan_flush+0x93/0x200 net/bridge/br_vlan.c:1362 del_nbp+0x3c6/0xd20 net/bridge/br_if.c:346 br_dev_delete+0x95/0x190 net/bridge/br_if.c:376 br_del_bridge+0xb7/0xf0 net/bridge/br_if.c:485 br_ioctl_stub+0x36d/0x7d0 net/bridge/br_ioctl.c:428 br_ioctl_call+0x5e/0xa0 net/socket.c:1096 sock_ioctl+0x30c/0x640 net/socket.c:1193 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 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+0x44/0xae RIP: 0033:0x7f00cc0890e9 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 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f00caffe168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007f00cc19bf60 RCX: 00007f00cc0890e9 RDX: 0000000020000080 RSI: 00000000000089a1 RDI: 000000000000000e RBP: 00007f00cc0e308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fffde45cc7f R14: 00007f00caffe300 R15: 0000000000022000 Allocated by task 3605: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] __kasan_slab_alloc+0x90/0xc0 mm/kasan/common.c:469 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:749 [inline] slab_alloc_node mm/slub.c:3217 [inline] slab_alloc mm/slub.c:3225 [inline] __kmem_cache_alloc_lru mm/slub.c:3232 [inline] kmem_cache_alloc+0x204/0x3b0 mm/slub.c:3242 kmem_cache_zalloc include/linux/slab.h:704 [inline] net_alloc net/core/net_namespace.c:403 [inline] copy_net_ns+0x125/0x760 net/core/net_namespace.c:458 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:3132 __do_sys_unshare kernel/fork.c:3203 [inline] __se_sys_unshare kernel/fork.c:3201 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3201 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+0x44/0xae Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x62e/0x1140 kernel/workqueue.c:1517 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1461 [inline] __run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1737 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0x152/0x1d0 kernel/time/timer.c:1752 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 insert_work+0x48/0x350 kernel/workqueue.c:1358 __queue_work+0x62e/0x1140 kernel/workqueue.c:1517 call_timer_fn+0x1a5/0x6b0 kernel/time/timer.c:1421 expire_timers kernel/time/timer.c:1461 [inline] __run_timers.part.0+0x4a3/0xa80 kernel/time/timer.c:1737 __run_timers kernel/time/timer.c:1715 [inline] run_timer_softirq+0x152/0x1d0 kernel/time/timer.c:1752 __do_softirq+0x29b/0x9c2 kernel/softirq.c:558 The buggy address belongs to the object at ffff88801fb80000 which belongs to the cache net_namespace of size 6784 The buggy address is located 704 bytes inside of 6784-byte region [ffff88801fb80000, ffff88801fb81a80) The buggy address belongs to the physical page: page:ffffea00007ee000 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801fb80000 pfn:0x1fb80 head:ffffea00007ee000 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff888068c3ea01 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888010dcd3c0 raw: ffff88801fb80000 0000000080040000 00000001ffffffff ffff888068c3ea01 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 3605, tgid 3605 (syz-executor.0), ts 48230007126, free_ts 47205215395 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408 alloc_pages+0x1aa/0x310 mm/mempolicy.c:2272 alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x26c/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8df/0xf20 mm/slub.c:3005 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3092 slab_alloc_node mm/slub.c:3183 [inline] slab_alloc mm/slub.c:3225 [inline] __kmem_cache_alloc_lru mm/slub.c:3232 [inline] kmem_cache_alloc+0x360/0x3b0 mm/slub.c:3242 kmem_cache_zalloc include/linux/slab.h:704 [inline] net_alloc net/core/net_namespace.c:403 [inline] copy_net_ns+0x125/0x760 net/core/net_namespace.c:458 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:3132 __do_sys_unshare kernel/fork.c:3203 [inline] __se_sys_unshare kernel/fork.c:3201 [inline] __x64_sys_unshare+0x2d/0x40 kernel/fork.c:3201 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+0x44/0xae page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1356 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2523 qlink_free mm/kasan/quarantine.c:157 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0xa2/0xc0 mm/kasan/common.c:446 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:749 [inline] slab_alloc_node mm/slub.c:3217 [inline] slab_alloc mm/slub.c:3225 [inline] __kmalloc+0x200/0x350 mm/slub.c:4410 kmalloc include/linux/slab.h:586 [inline] tomoyo_add_entry security/tomoyo/common.c:2022 [inline] tomoyo_supervisor+0xce6/0xf00 security/tomoyo/common.c:2094 tomoyo_audit_path_log security/tomoyo/file.c:168 [inline] tomoyo_path_permission security/tomoyo/file.c:587 [inline] tomoyo_path_permission+0x270/0x3a0 security/tomoyo/file.c:573 tomoyo_check_open_permission+0x33e/0x380 security/tomoyo/file.c:777 tomoyo_file_open security/tomoyo/tomoyo.c:311 [inline] tomoyo_file_open+0x9d/0xc0 security/tomoyo/tomoyo.c:306 security_file_open+0x45/0xb0 security/security.c:1651 do_dentry_open+0x349/0x11e0 fs/open.c:811 do_open fs/namei.c:3476 [inline] path_openat+0x1c71/0x2910 fs/namei.c:3609 do_filp_open+0x1aa/0x400 fs/namei.c:3636 do_sys_openat2+0x16d/0x4c0 fs/open.c:1213 Memory state around the buggy address: ffff88801fb80180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801fb80200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88801fb80280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801fb80300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801fb80380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ---------------- Code disassembly (best guess): 0: 54 push %rsp 1: d3 50 00 rcll %cl,0x0(%rax) 4: 5b pop %rbx 5: e9 c0 6d 5c f8 jmpq 0xf85c6dca a: e8 bb 6d 5c f8 callq 0xf85c6dca f: 48 8b 3d 94 97 7c 07 mov 0x77c9794(%rip),%rdi # 0x77c97aa 16: e9 5f f4 0b fa jmpq 0xfa0bf47a 1b: cc int3 1c: cc int3 1d: cc int3 1e: cc int3 1f: cc int3 20: cc int3 21: cc int3 22: cc int3 23: cc int3 24: cc int3 25: cc int3 26: cc int3 27: cc int3 28: cc int3 29: cc int3 * 2a: 41 56 push %r14 <-- trapping instruction 2c: 41 55 push %r13 2e: 41 54 push %r12 30: 49 89 fc mov %rdi,%r12 33: 55 push %rbp 34: 53 push %rbx 35: 48 89 f3 mov %rsi,%rbx 38: e8 8d 6d 5c f8 callq 0xf85c6dca 3d: 48 rex.W 3e: 8d .byte 0x8d 3f: 7b .byte 0x7b