================================================================== ================================================================== BUG: KASAN: use-after-free in rb_erase_linked+0x175/0x190 lib/rbtree.c:457 Write of size 8 at addr ffffc90004457d68 by task syz-executor/10454 CPU: 0 UID: 0 PID: 10454 Comm: syz-executor Not tainted syzkaller #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x100/0x190 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x13d/0x4b0 mm/kasan/report.c:482 kasan_report+0xdf/0x1c0 mm/kasan/report.c:595 rb_erase_linked+0x175/0x190 lib/rbtree.c:457 timerqueue_linked_del include/linux/timerqueue.h:66 [inline] __remove_hrtimer+0x116/0x650 kernel/time/hrtimer.c:1183 __run_hrtimer kernel/time/hrtimer.c:2059 [inline] __hrtimer_run_queues+0x339/0x9a0 kernel/time/hrtimer.c:2136 hrtimer_interrupt+0x441/0xaa0 kernel/time/hrtimer.c:2255 local_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1051 [inline] __sysvec_apic_timer_interrupt+0x109/0x470 arch/x86/kernel/apic/apic.c:1068 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1062 [inline] sysvec_apic_timer_interrupt+0x9e/0xc0 arch/x86/kernel/apic/apic.c:1062 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:674 RIP: 0010:check_kcov_mode kernel/kcov.c:181 [inline] RIP: 0010:__sanitizer_cov_trace_pc+0x40/0x70 kernel/kcov.c:223 Code: ac 13 48 63 c8 a9 00 01 00 ff 74 1e f6 c4 01 74 44 a9 00 00 00 0f 75 3d f7 c1 00 00 00 f0 75 35 8b 82 44 17 00 00 85 c0 74 2b <8b> 82 18 17 00 00 83 f8 02 75 20 48 8b 8a 20 17 00 00 8b 92 1c 17 RSP: 0000:ffffc9000d4bf580 EFLAGS: 00000246 RAX: 8000000000000000 RBX: ffff888015731dc4 RCX: 0000000000000000 RDX: ffff888043e34b00 RSI: ffffffff8be91103 RDI: 0000000000000005 RBP: 00000000ffffffff R08: 0000000000000000 R09: 00000000fffffff8 R10: 0000000000000200 R11: 0000000000000001 R12: 00000000fffffff8 R13: ffff888095731dbf R14: ffffc9000d4bf627 R15: dffffc0000000000 number+0x983/0xc90 lib/vsprintf.c:578 vsnprintf+0x30e/0x1300 lib/vsprintf.c:2912 sprintf+0xcc/0x100 lib/vsprintf.c:3115 proc_self_get_link+0x11b/0x1f0 fs/proc/self.c:25 pick_link+0xabc/0x13c0 fs/namei.c:2070 step_into_slowpath+0x9ba/0xf90 fs/namei.c:2133 step_into fs/namei.c:2158 [inline] walk_component fs/namei.c:2294 [inline] link_path_walk+0xe4a/0x1bd0 fs/namei.c:2662 path_openat+0x1a7/0x23f0 fs/namei.c:5012 do_file_open+0x20e/0x430 fs/namei.c:5045 do_sys_openat2+0x163/0x1d0 fs/open.c:1443 do_sys_open fs/open.c:1449 [inline] __do_compat_sys_openat fs/open.c:1511 [inline] __se_compat_sys_openat fs/open.c:1509 [inline] __ia32_compat_sys_openat+0x12d/0x210 fs/open.c:1509 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] do_int80_emulation+0x16a/0x670 arch/x86/entry/syscall_32.c:170 asm_int80_emulation+0x1a/0x20 arch/x86/include/asm/idtentry.h:598 RIP: 0023:0xf710032b Code: 57 56 53 8b 44 24 14 f6 00 08 75 23 8b 44 24 18 8b 5c 24 1c 8b 4c 24 20 8b 54 24 24 8b 74 24 28 8b 7c 24 2c 8b 6c 24 30 cd 80 <5b> 5e 5f 5d c3 5b 5e 5f 5d e9 f7 a1 ff ff 66 90 66 90 66 90 90 53 RSP: 002b:00000000ff7ffe4c EFLAGS: 00000246 ORIG_RAX: 0000000000000127 RAX: ffffffffffffffda RBX: 00000000ffffff9c RCX: 00000000f71c4fcb RDX: 0000000000080001 RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000286 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to a 8-page vmalloc region starting at 0xffffc90004450000 allocated at kernel_clone+0x176/0x9d0 kernel/fork.c:2798 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x57077 flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 0000000000000000 ffffea00015c1dc8 0000000000000000 raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x29c2(GFP_NOWAIT|__GFP_HIGHMEM|__GFP_IO|__GFP_FS|__GFP_ZERO), pid 5787, tgid 5787 (syz-executor), ts 47729272710 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0xfd/0x120 mm/page_alloc.c:1860 prep_new_page mm/page_alloc.c:1868 [inline] get_page_from_freelist+0xdae/0x2c80 mm/page_alloc.c:3950 __alloc_frozen_pages_noprof+0x2ad/0x31e0 mm/page_alloc.c:5492 alloc_pages_mpol+0x201/0x560 mm/mempolicy.c:2513 alloc_pages_noprof+0x1a/0x160 mm/mempolicy.c:2604 vm_area_alloc_pages mm/vmalloc.c:3726 [inline] __vmalloc_area_node mm/vmalloc.c:3948 [inline] __vmalloc_node_range_noprof+0x899/0x1440 mm/vmalloc.c:4152 __vmalloc_node_noprof+0xad/0xf0 mm/vmalloc.c:4213 alloc_thread_stack_node kernel/fork.c:359 [inline] dup_task_struct kernel/fork.c:931 [inline] copy_process+0x80b/0x88e0 kernel/fork.c:2150 kernel_clone+0x176/0x9d0 kernel/fork.c:2798 __do_compat_sys_ia32_clone+0xd4/0x120 arch/x86/kernel/sys_ia32.c:255 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:79 [inline] __do_fast_syscall_32+0x14d/0x8e0 arch/x86/entry/syscall_32.c:286 do_fast_syscall_32+0x32/0x70 arch/x86/entry/syscall_32.c:311 entry_SYSENTER_compat_after_hwframe+0x84/0x8e page last free pid 5776 tgid 5776 ts 45120340963 stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] __free_pages_prepare mm/page_alloc.c:1402 [inline] __free_frozen_pages+0x7b1/0x10f0 mm/page_alloc.c:2958 __folio_put+0x3b4/0x5f0 mm/folio.c:106 folio_put include/linux/mm.h:2305 [inline] put_page include/linux/mm.h:2374 [inline] netmem_dec_ref include/net/netmem.h:444 [inline] skb_netmem_unref include/linux/skbuff_ref.h:64 [inline] skb_release_data+0x60c/0x860 net/core/skbuff.c:1117 skb_release_all net/core/skbuff.c:1188 [inline] napi_consume_skb+0x1a6/0x320 net/core/skbuff.c:1540 __skb_defer_free_flush net/core/dev.c:7086 [inline] __skb_defer_free_flush net/core/dev.c:7074 [inline] skb_defer_free_flush+0x16b/0x290 net/core/dev.c:7108 net_rx_action+0x3ca/0xf20 net/core/dev.c:8186 handle_softirqs+0x216/0xa20 kernel/softirq.c:669 do_softirq kernel/softirq.c:569 [inline] do_softirq+0xaf/0xf0 kernel/softirq.c:556 __local_bh_enable_ip+0xff/0x120 kernel/softirq.c:473 local_bh_enable include/linux/bottom_half.h:33 [inline] rcu_read_unlock_bh include/linux/rcupdate.h:923 [inline] __dev_queue_xmit+0xa43/0x48d0 net/core/dev.c:5123 dev_queue_xmit include/linux/netdevice.h:3485 [inline] neigh_hh_output include/net/neighbour.h:538 [inline] neigh_output include/net/neighbour.h:552 [inline] ip_finish_output2+0xfa4/0x2740 net/ipv4/ip_output.c:236 __ip_finish_output.part.0+0x43b/0x6f0 net/ipv4/ip_output.c:314 __ip_finish_output net/ipv4/ip_output.c:302 [inline] ip_finish_output net/ipv4/ip_output.c:324 [inline] NF_HOOK_COND include/linux/netfilter.h:314 [inline] ip_output+0x392/0xc00 net/ipv4/ip_output.c:437 dst_output include/net/dst.h:471 [inline] ip_local_out+0x193/0x1f0 net/ipv4/ip_output.c:131 __ip_queue_xmit+0x876/0x1f50 net/ipv4/ip_output.c:533 __tcp_transmit_skb+0x34d9/0x4f00 net/ipv4/tcp_output.c:1772 Memory state around the buggy address: ffffc90004457c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffffc90004457c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffffc90004457d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffffc90004457d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffffc90004457e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess): 0: ac lods %ds:(%rsi),%al 1: 13 48 63 adc 0x63(%rax),%ecx 4: c8 a9 00 01 enter $0xa9,$0x1 8: 00 ff add %bh,%bh a: 74 1e je 0x2a c: f6 c4 01 test $0x1,%ah f: 74 44 je 0x55 11: a9 00 00 00 0f test $0xf000000,%eax 16: 75 3d jne 0x55 18: f7 c1 00 00 00 f0 test $0xf0000000,%ecx 1e: 75 35 jne 0x55 20: 8b 82 44 17 00 00 mov 0x1744(%rdx),%eax 26: 85 c0 test %eax,%eax 28: 74 2b je 0x55 * 2a: 8b 82 18 17 00 00 mov 0x1718(%rdx),%eax <-- trapping instruction 30: 83 f8 02 cmp $0x2,%eax 33: 75 20 jne 0x55 35: 48 8b 8a 20 17 00 00 mov 0x1720(%rdx),%rcx 3c: 8b .byte 0x8b 3d: 92 xchg %eax,%edx 3e: 1c 17 sbb $0x17,%al