================================================================== BUG: KASAN: use-after-free in rb_set_parent include/linux/rbtree_augmented.h:291 [inline] BUG: KASAN: use-after-free in ____rb_erase_color lib/rbtree.c:347 [inline] BUG: KASAN: use-after-free in rb_erase+0x12d6/0x12e0 lib/rbtree.c:445 Read of size 8 at addr ffffc90004c77d50 by task syz.2.1577/9787 CPU: 2 UID: 0 PID: 9787 Comm: syz.2.1577 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_set_parent include/linux/rbtree_augmented.h:291 [inline] ____rb_erase_color lib/rbtree.c:347 [inline] rb_erase+0x12d6/0x12e0 lib/rbtree.c:445 rb_erase_linked+0xc7/0x190 lib/rbtree.c:459 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:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:220 [inline] RIP: 0010:_raw_spin_unlock_irq+0x29/0x50 kernel/locking/spinlock.c:229 Code: 90 f3 0f 1e fa 53 48 8b 74 24 08 48 89 fb 48 83 c7 18 e8 fa ba f8 f5 48 89 df e8 82 11 f9 f5 e8 0d 09 26 f6 fb bf 01 00 00 00 d2 d7 e7 f5 65 48 83 3d c1 42 ca 09 00 74 06 5b c3 cc cc cc cc RSP: 0000:ffffc90007aa7c08 EFLAGS: 00000202 RAX: 000000000000012f RBX: ffffffff90cc5880 RCX: 0000000000000080 RDX: 0000000000000001 RSI: ffffffff8e625648 RDI: 0000000000000001 RBP: 0000000000000060 R08: 0000000000000001 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000000 R12: ffff8880234e8000 R13: 0000000063702f73 R14: ffffffff8be17c80 R15: 000000000000009c pci_user_write_config_dword+0x150/0x230 drivers/pci/access.c:278 proc_bus_pci_write+0x531/0x5e0 drivers/pci/proc.c:173 pde_write fs/proc/inode.c:330 [inline] proc_reg_write+0x240/0x330 fs/proc/inode.c:342 vfs_write+0x2aa/0x1040 fs/read_write.c:665 ksys_write+0x12a/0x250 fs/read_write.c:719 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 RIP: 0023:0xf7f73fbc Code: d2 74 05 c1 e8 0c 89 02 8b 5d fc 31 c0 c9 c3 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 0f 1f 00 51 52 55 89 e5 0f 34 cd 80 <5d> 5a 59 c3 90 2e 8d b4 26 00 00 00 00 8d b4 26 00 00 00 00 58 b8 RSP: 002b:00000000f542650c EFLAGS: 00000292 ORIG_RAX: 0000000000000004 RAX: ffffffffffffffda RBX: 0000000000000003 RCX: 0000000080000300 RDX: 000000000000010f RSI: 0000000000000000 RDI: 0000000000000000 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000292 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The buggy address belongs to a 8-page vmalloc region starting at 0xffffc90004c70000 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:0x4e5af flags: 0x4fff00000000000(node=1|zone=1|lastcpupid=0x7ff) raw: 04fff00000000000 0000000000000000 ffffea0001396bc8 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 5786, tgid 5786 (syz-executor), ts 37419399075 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 0 tgid 0 ts 37376240021 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 page_frag_free+0x199/0x1f0 mm/page_frag_cache.c:174 skb_free_frag include/linux/skbuff.h:3556 [inline] skb_free_head+0x9a/0x160 net/core/skbuff.c:1094 skb_release_data+0x698/0x860 net/core/skbuff.c:1124 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:703 [inline] invoke_softirq kernel/softirq.c:542 [inline] __irq_exit_rcu+0x178/0x220 kernel/softirq.c:786 irq_exit_rcu+0x9/0x30 kernel/softirq.c:809 common_interrupt+0xbe/0xe0 arch/x86/kernel/irq.c:273 asm_common_interrupt+0x26/0x40 arch/x86/include/asm/idtentry.h:665 Memory state around the buggy address: ffffc90004c77c00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffffc90004c77c80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffffc90004c77d00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffffc90004c77d80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffffc90004c77e00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== ---------------- Code disassembly (best guess): 0: 90 nop 1: f3 0f 1e fa endbr64 5: 53 push %rbx 6: 48 8b 74 24 08 mov 0x8(%rsp),%rsi b: 48 89 fb mov %rdi,%rbx e: 48 83 c7 18 add $0x18,%rdi 12: e8 fa ba f8 f5 call 0xf5f8bb11 17: 48 89 df mov %rbx,%rdi 1a: e8 82 11 f9 f5 call 0xf5f911a1 1f: e8 0d 09 26 f6 call 0xf6260931 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 d2 d7 e7 f5 call 0xf5e7d801 <-- trapping instruction 2f: 65 48 83 3d c1 42 ca cmpq $0x0,%gs:0x9ca42c1(%rip) # 0x9ca42f9 36: 09 00 38: 74 06 je 0x40 3a: 5b pop %rbx 3b: c3 ret 3c: cc int3 3d: cc int3 3e: cc int3 3f: cc int3