================================================================== 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+0x998/0x9f0 net/ipv4/tcp_timer.c:594 Read of size 1 at addr ffff8880496107e5 by task syz-executor.1/12348 CPU: 0 PID: 12348 Comm: syz-executor.1 Not tainted 6.0.0-rc5-syzkaller-00089-g6879c2d3b960 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/26/2022 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:317 [inline] print_report.cold+0x2ba/0x6e9 mm/kasan/report.c:433 kasan_report+0xb1/0x1e0 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+0x998/0x9f0 net/ipv4/tcp_timer.c:594 tcp_write_timer+0xa2/0x2b0 net/ipv4/tcp_timer.c:637 call_timer_fn+0x1a0/0x6b0 kernel/time/timer.c:1474 expire_timers kernel/time/timer.c:1519 [inline] __run_timers.part.0+0x674/0xa80 kernel/time/timer.c:1790 __run_timers kernel/time/timer.c:1768 [inline] run_timer_softirq+0xb3/0x1d0 kernel/time/timer.c:1803 __do_softirq+0x1d3/0x9c6 kernel/softirq.c:571 invoke_softirq kernel/softirq.c:445 [inline] __irq_exit_rcu+0x123/0x180 kernel/softirq.c:650 irq_exit_rcu+0x5/0x20 kernel/softirq.c:662 sysvec_apic_timer_interrupt+0x93/0xc0 arch/x86/kernel/apic/apic.c:1106 asm_sysvec_apic_timer_interrupt+0x16/0x20 arch/x86/include/asm/idtentry.h:649 RIP: 0010:__kasan_check_write+0x0/0x10 mm/kasan/shadow.c:37 Code: 05 00 80 00 00 48 89 fb 48 39 c7 0f 82 2b 2e 76 07 eb e1 cc cc cc cc cc cc cc 48 8b 0c 24 89 f6 31 d2 e9 b3 fa ff ff 0f 1f 00 <48> 8b 0c 24 89 f6 ba 01 00 00 00 e9 a0 fa ff ff 55 53 48 8b 07 48 RSP: 0018:ffffc90004ad73e8 EFLAGS: 00000246 RAX: 0000000000000001 RBX: 1ffff9200095ae7f RCX: ffffffff815f1ea1 RDX: ffffed10043581bd RSI: 0000000000000004 RDI: ffffc90004ad7418 RBP: ffff888021ac0de0 R08: 0000000000000001 R09: ffff888021ac0de3 R10: ffffed10043581bc R11: 0000000000000000 R12: ffff888021ac0de8 R13: ffff888021ac0df0 R14: ffff888000000000 R15: ffffea0001757a00 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:542 [inline] queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] do_raw_spin_lock+0x120/0x2a0 kernel/locking/spinlock_debug.c:115 spin_lock include/linux/spinlock.h:349 [inline] wp_page_copy+0x639/0x1b60 mm/memory.c:3147 do_wp_page+0x1d1/0x1910 mm/memory.c:3404 handle_pte_fault mm/memory.c:4929 [inline] __handle_mm_fault+0x1813/0x39b0 mm/memory.c:5053 handle_mm_fault+0x1c8/0x780 mm/memory.c:5151 do_user_addr_fault+0x475/0x1210 arch/x86/mm/fault.c:1397 handle_page_fault arch/x86/mm/fault.c:1488 [inline] exc_page_fault+0x94/0x170 arch/x86/mm/fault.c:1544 asm_exc_page_fault+0x22/0x30 arch/x86/include/asm/idtentry.h:570 RIP: 0010:copy_user_enhanced_fast_string+0xa/0x40 arch/x86/lib/copy_user_64.S:166 Code: ff c9 75 f2 89 d1 c1 e9 03 83 e2 07 f3 48 a5 89 d1 f3 a4 31 c0 0f 01 ca c3 8d 0c ca 89 ca eb 20 0f 01 cb 83 fa 40 72 38 89 d1 a4 31 c0 0f 01 ca c3 89 ca eb 0a 66 2e 0f 1f 84 00 00 00 00 00 RSP: 0018:ffffc90004ad78f8 EFLAGS: 00050206 RAX: 0000000000000001 RBX: 0000000000001000 RCX: 0000000000000e80 RDX: 0000000000001000 RSI: ffff88800f4e3180 RDI: 00000000202c5000 RBP: 00007fffffffe000 R08: 0000000000000000 R09: ffff88800f4e3fff R10: ffffed1001e9c7ff R11: 0000000000000000 R12: 00000000202c4e80 R13: ffff88800f4e3000 R14: ffff88800f4e3000 R15: 0000000000000000 copy_user_generic arch/x86/include/asm/uaccess_64.h:37 [inline] raw_copy_to_user arch/x86/include/asm/uaccess_64.h:58 [inline] copyout lib/iov_iter.c:170 [inline] copyout+0xf6/0x120 lib/iov_iter.c:164 _copy_to_iter+0x537/0x13c0 lib/iov_iter.c:524 copy_page_to_iter+0x35f/0xe40 lib/iov_iter.c:722 process_vm_rw_pages mm/process_vm_access.c:45 [inline] process_vm_rw_single_vec mm/process_vm_access.c:117 [inline] process_vm_rw_core.constprop.0+0x5c3/0x980 mm/process_vm_access.c:215 process_vm_rw+0x29c/0x300 mm/process_vm_access.c:283 __do_sys_process_vm_readv mm/process_vm_access.c:295 [inline] __se_sys_process_vm_readv mm/process_vm_access.c:291 [inline] __x64_sys_process_vm_readv+0xdf/0x1b0 mm/process_vm_access.c:291 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+0x63/0xcd RIP: 0033:0x7fe2c0e89409 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:00007fe2bfdfe168 EFLAGS: 00000246 ORIG_RAX: 0000000000000136 RAX: ffffffffffffffda RBX: 00007fe2c0f9bf80 RCX: 00007fe2c0e89409 RDX: 0000000000000002 RSI: 0000000020008400 RDI: 000000000000004c RBP: 00007fe2c0ee4367 R08: 0000000000000286 R09: 0000000000000000 R10: 0000000020008640 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe5b92517f R14: 00007fe2bfdfe300 R15: 0000000000022000 The buggy address belongs to the physical page: page:ffffea0001258400 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x49610 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000000 ffffea00016ec008 ffffea0001567f08 0000000000000000 raw: 0000000000000000 ffff888049610000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 1, migratetype Unmovable, gfp_mask 0x342040(__GFP_IO|__GFP_NOWARN|__GFP_COMP|__GFP_HARDWALL|__GFP_THISNODE), pid 11823, tgid 11823 (rm), ts 649163497619, free_ts 690377247987 prep_new_page mm/page_alloc.c:2532 [inline] get_page_from_freelist+0x109b/0x2ce0 mm/page_alloc.c:4283 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5515 __alloc_pages_node include/linux/gfp.h:243 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x360 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3018 [inline] ____cache_alloc mm/slab.c:3001 [inline] __do_cache_alloc mm/slab.c:3246 [inline] slab_alloc mm/slab.c:3287 [inline] __do_kmalloc mm/slab.c:3684 [inline] __kmalloc+0x3a1/0x4a0 mm/slab.c:3695 kmalloc include/linux/slab.h:605 [inline] tomoyo_realpath_from_path+0xc3/0x620 security/tomoyo/realpath.c:254 tomoyo_get_realpath security/tomoyo/file.c:151 [inline] tomoyo_path_perm+0x21b/0x400 security/tomoyo/file.c:822 tomoyo_path_unlink+0x8e/0xd0 security/tomoyo/tomoyo.c:149 security_path_unlink+0xd7/0x150 security/security.c:1173 do_unlinkat+0x363/0x650 fs/namei.c:4293 __do_sys_unlink fs/namei.c:4345 [inline] __se_sys_unlink fs/namei.c:4343 [inline] __x64_sys_unlink+0xc6/0x110 fs/namei.c:4343 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+0x63/0xcd page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1449 [inline] free_pcp_prepare+0x5e4/0xd20 mm/page_alloc.c:1499 free_unref_page_prepare mm/page_alloc.c:3380 [inline] free_unref_page+0x19/0x4d0 mm/page_alloc.c:3476 slab_destroy mm/slab.c:1615 [inline] slabs_destroy+0x89/0xc0 mm/slab.c:1635 cache_flusharray mm/slab.c:3389 [inline] ___cache_free+0x2a8/0x3d0 mm/slab.c:3452 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x4f/0x1b0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x180/0x200 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x97/0xb0 mm/kasan/common.c:447 kasan_slab_alloc include/linux/kasan.h:224 [inline] slab_post_alloc_hook mm/slab.h:727 [inline] slab_alloc mm/slab.c:3294 [inline] __kmem_cache_alloc_lru mm/slab.c:3471 [inline] kmem_cache_alloc+0x214/0x520 mm/slab.c:3491 kmem_cache_zalloc include/linux/slab.h:723 [inline] jbd2_alloc_handle include/linux/jbd2.h:1596 [inline] new_handle fs/jbd2/transaction.c:476 [inline] jbd2__journal_start+0x18c/0x910 fs/jbd2/transaction.c:503 __ext4_journal_start_sb+0x3a3/0x490 fs/ext4/ext4_jbd2.c:105 __ext4_journal_start fs/ext4/ext4_jbd2.h:326 [inline] ext4_dirty_inode+0x9d/0x110 fs/ext4/inode.c:5963 __mark_inode_dirty+0x48b/0x1040 fs/fs-writeback.c:2381 generic_update_time fs/inode.c:1860 [inline] inode_update_time fs/inode.c:1873 [inline] touch_atime+0x63d/0x700 fs/inode.c:1945 file_accessed include/linux/fs.h:2516 [inline] filemap_read+0xc0c/0xe10 mm/filemap.c:2728 generic_file_read_iter+0x3b0/0x5a0 mm/filemap.c:2806 ext4_file_read_iter+0x1d5/0x600 fs/ext4/file.c:132 Memory state around the buggy address: ffff888049610680: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888049610700: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888049610780: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888049610800: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888049610880: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess): 0: 05 00 80 00 00 add $0x8000,%eax 5: 48 89 fb mov %rdi,%rbx 8: 48 39 c7 cmp %rax,%rdi b: 0f 82 2b 2e 76 07 jb 0x7762e3c 11: eb e1 jmp 0xfffffff4 13: cc int3 14: cc int3 15: cc int3 16: cc int3 17: cc int3 18: cc int3 19: cc int3 1a: 48 8b 0c 24 mov (%rsp),%rcx 1e: 89 f6 mov %esi,%esi 20: 31 d2 xor %edx,%edx 22: e9 b3 fa ff ff jmpq 0xfffffada 27: 0f 1f 00 nopl (%rax) * 2a: 48 8b 0c 24 mov (%rsp),%rcx <-- trapping instruction 2e: 89 f6 mov %esi,%esi 30: ba 01 00 00 00 mov $0x1,%edx 35: e9 a0 fa ff ff jmpq 0xfffffada 3a: 55 push %rbp 3b: 53 push %rbx 3c: 48 8b 07 mov (%rdi),%rax 3f: 48 rex.W