================================================================== BUG: KASAN: use-after-free in hlist_move_list include/linux/list.h:852 [inline] BUG: KASAN: use-after-free in __collect_expired_timers kernel/time/timer.c:1484 [inline] BUG: KASAN: use-after-free in collect_expired_timers kernel/time/timer.c:1719 [inline] BUG: KASAN: use-after-free in __run_timers+0x4a8/0x6b0 kernel/time/timer.c:1783 Write of size 8 at addr ffff8881ca7c71c8 by task syz-executor.2/2069 CPU: 0 PID: 2069 Comm: syz-executor.2 Not tainted 5.4.210-syzkaller-00005-g8c70a830a157 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x18e/0x1d5 lib/dump_stack.c:118 print_address_description+0x8c/0x630 mm/kasan/report.c:384 __kasan_report+0xf6/0x130 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 hlist_move_list include/linux/list.h:852 [inline] __collect_expired_timers kernel/time/timer.c:1484 [inline] collect_expired_timers kernel/time/timer.c:1719 [inline] __run_timers+0x4a8/0x6b0 kernel/time/timer.c:1783 run_timer_softirq+0x46/0x80 kernel/time/timer.c:1800 __do_softirq+0x23e/0x643 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x195/0x1c0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:538 [inline] smp_apic_timer_interrupt+0x113/0x440 arch/x86/kernel/apic/apic.c:1150 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:831 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline] RIP: 0010:_raw_spin_unlock_irq+0x45/0x60 kernel/locking/spinlock.c:199 Code: 08 00 74 0c 48 c7 c7 d0 cd aa 85 e8 55 15 6d fd 48 83 3d 2d d8 8a 01 00 74 29 48 89 df e8 43 87 29 fd 66 90 fb bf 01 00 00 00 66 f9 22 fd 65 8b 05 cb 97 e2 7b 85 c0 74 02 5b c3 e8 34 4c e0 RSP: 0000:ffff8881f4fe7178 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: ffff8881c1941bf0 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff8881c1941c48 R08: ffffffff821d1134 R09: ffffed103e9fce2a R10: ffffed103e9fce2a R11: 1ffff1103e9fce29 R12: 0000000000000cc0 R13: ffff8881f4fe71e8 R14: 0000000000000cc0 R15: ffffea0007488480 spin_unlock_irq include/linux/spinlock.h:388 [inline] __add_to_page_cache_locked+0x49b/0x820 mm/filemap.c:915 add_to_page_cache_lru+0xcf/0x260 mm/filemap.c:962 pagecache_get_page+0x539/0x760 mm/filemap.c:1701 grab_cache_page_write_begin+0x50/0x90 mm/filemap.c:3261 ext4_da_write_begin+0x52b/0xef0 fs/ext4/inode.c:3137 generic_perform_write+0x290/0x510 mm/filemap.c:3311 __generic_file_write_iter+0x239/0x490 mm/filemap.c:3440 ext4_file_write_iter+0x46e/0x1040 fs/ext4/file.c:270 call_write_iter include/linux/fs.h:1976 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x4f9/0x6a0 fs/read_write.c:496 __kernel_write+0x12c/0x340 fs/read_write.c:515 dump_emit+0x1cc/0x2d0 fs/coredump.c:838 elf_core_dump+0x39f1/0x42a0 fs/binfmt_elf.c:2352 do_coredump+0x1d70/0x2ca0 fs/coredump.c:801 get_signal+0xd5b/0x13f0 kernel/signal.c:2729 do_signal+0x41/0x10a0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xdd/0x1d0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x17c/0x1d0 arch/x86/entry/common.c:194 retint_user+0x8/0x8 RIP: 0033:0x7f0c0e9e25b1 Code: 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 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:00002a452cb9d000 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f0c0eb03050 RCX: 00007f0c0e9e25a9 RDX: 0000000000000000 RSI: 00002a452cb9d000 RDI: 0000000050000000 RBP: 00007f0c0ea3d580 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffd082b685f R14: 00007f0c0db35300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea000729f1c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 ffffea0007ad7fc8 ffffea00071414c8 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102cc2(GFP_HIGHUSER|__GFP_NOWARN) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x194/0x380 mm/page_alloc.c:2171 get_page_from_freelist+0x524/0x560 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x2ab/0x6f0 mm/page_alloc.c:4857 __alloc_pages include/linux/gfp.h:503 [inline] __alloc_pages_node include/linux/gfp.h:516 [inline] alloc_pages_node include/linux/gfp.h:530 [inline] pcpu_alloc_pages mm/percpu-vm.c:94 [inline] pcpu_populate_chunk+0x121/0xca0 mm/percpu-vm.c:284 pcpu_alloc+0x7dc/0x1060 mm/percpu.c:1714 prealloc_init kernel/bpf/hashtab.c:154 [inline] htab_map_alloc+0x88c/0x11f0 kernel/bpf/hashtab.c:378 find_and_alloc_map kernel/bpf/syscall.c:122 [inline] map_create kernel/bpf/syscall.c:573 [inline] __do_sys_bpf kernel/bpf/syscall.c:2871 [inline] __se_sys_bpf+0x301e/0xba40 kernel/bpf/syscall.c:2847 do_syscall_64+0xcb/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare+0x1a4/0x290 mm/page_alloc.c:1233 free_unref_page_prepare mm/page_alloc.c:3085 [inline] free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4917 [inline] __free_pages+0x52/0x1e0 mm/page_alloc.c:4925 pcpu_free_pages mm/percpu-vm.c:64 [inline] pcpu_depopulate_chunk mm/percpu-vm.c:328 [inline] pcpu_balance_workfn+0x934/0x1270 mm/percpu.c:1865 process_one_work+0x6ca/0xc40 kernel/workqueue.c:2287 worker_thread+0xae0/0x1440 kernel/workqueue.c:2433 kthread+0x2d8/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 Memory state around the buggy address: ffff8881ca7c7080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881ca7c7100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881ca7c7180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881ca7c7200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881ca7c7280: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== BUG: kernel NULL pointer dereference, address: 0000000000000000 #PF: supervisor instruction fetch in kernel mode #PF: error_code(0x0010) - not-present page PGD 1d135b067 P4D 1d135b067 PUD 1c4d4c067 PMD 0 Oops: 0010 [#1] PREEMPT SMP KASAN CPU: 0 PID: 2069 Comm: syz-executor.2 Tainted: G B 5.4.210-syzkaller-00005-g8c70a830a157 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/11/2022 RIP: 0010:0x0 Code: Bad RIP value. RSP: 0000:ffff8881f6e09d30 EFLAGS: 00010202 RAX: ffffffff8151cbb9 RBX: 0000000000000101 RCX: ffff8881ed552f40 RDX: 0000000000000101 RSI: 0000000000000000 RDI: ffff8881ca7c71c0 RBP: ffff8881ca7c71e0 R08: ffffffff8151c992 R09: fffffbfff0d7370d R10: fffffbfff0d7370d R11: 1ffffffff0d7370c R12: 00000000ffffa4a0 R13: 1ffff1103edc92f1 R14: 0000000000000000 R15: ffff8881ca7c71c0 FS: 00007f0c0db35700(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001ca4ff000 CR4: 00000000003406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: call_timer_fn+0x31/0x350 kernel/time/timer.c:1418 expire_timers+0x21e/0x400 kernel/time/timer.c:1463 __run_timers+0x5b0/0x6b0 kernel/time/timer.c:1787 run_timer_softirq+0x46/0x80 kernel/time/timer.c:1800 __do_softirq+0x23e/0x643 kernel/softirq.c:292 invoke_softirq kernel/softirq.c:373 [inline] irq_exit+0x195/0x1c0 kernel/softirq.c:413 exiting_irq arch/x86/include/asm/apic.h:538 [inline] smp_apic_timer_interrupt+0x113/0x440 arch/x86/kernel/apic/apic.c:1150 apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:831 RIP: 0010:__raw_spin_unlock_irq include/linux/spinlock_api_smp.h:169 [inline] RIP: 0010:_raw_spin_unlock_irq+0x45/0x60 kernel/locking/spinlock.c:199 Code: 08 00 74 0c 48 c7 c7 d0 cd aa 85 e8 55 15 6d fd 48 83 3d 2d d8 8a 01 00 74 29 48 89 df e8 43 87 29 fd 66 90 fb bf 01 00 00 00 66 f9 22 fd 65 8b 05 cb 97 e2 7b 85 c0 74 02 5b c3 e8 34 4c e0 RSP: 0000:ffff8881f4fe7178 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000001 RBX: ffff8881c1941bf0 RCX: dffffc0000000000 RDX: 0000000000000000 RSI: 0000000000000001 RDI: 0000000000000001 RBP: ffff8881c1941c48 R08: ffffffff821d1134 R09: ffffed103e9fce2a R10: ffffed103e9fce2a R11: 1ffff1103e9fce29 R12: 0000000000000cc0 R13: ffff8881f4fe71e8 R14: 0000000000000cc0 R15: ffffea0007488480 spin_unlock_irq include/linux/spinlock.h:388 [inline] __add_to_page_cache_locked+0x49b/0x820 mm/filemap.c:915 add_to_page_cache_lru+0xcf/0x260 mm/filemap.c:962 pagecache_get_page+0x539/0x760 mm/filemap.c:1701 grab_cache_page_write_begin+0x50/0x90 mm/filemap.c:3261 ext4_da_write_begin+0x52b/0xef0 fs/ext4/inode.c:3137 generic_perform_write+0x290/0x510 mm/filemap.c:3311 __generic_file_write_iter+0x239/0x490 mm/filemap.c:3440 ext4_file_write_iter+0x46e/0x1040 fs/ext4/file.c:270 call_write_iter include/linux/fs.h:1976 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x4f9/0x6a0 fs/read_write.c:496 __kernel_write+0x12c/0x340 fs/read_write.c:515 dump_emit+0x1cc/0x2d0 fs/coredump.c:838 elf_core_dump+0x39f1/0x42a0 fs/binfmt_elf.c:2352 do_coredump+0x1d70/0x2ca0 fs/coredump.c:801 get_signal+0xd5b/0x13f0 kernel/signal.c:2729 do_signal+0x41/0x10a0 arch/x86/kernel/signal.c:809 exit_to_usermode_loop+0xdd/0x1d0 arch/x86/entry/common.c:159 prepare_exit_to_usermode+0x17c/0x1d0 arch/x86/entry/common.c:194 retint_user+0x8/0x8 RIP: 0033:0x7f0c0e9e25b1 Code: 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 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:00002a452cb9d000 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f0c0eb03050 RCX: 00007f0c0e9e25a9 RDX: 0000000000000000 RSI: 00002a452cb9d000 RDI: 0000000050000000 RBP: 00007f0c0ea3d580 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000206 R12: 0000000000000000 R13: 00007ffd082b685f R14: 00007f0c0db35300 R15: 0000000000022000 Modules linked in: CR2: 0000000000000000 ---[ end trace 3deb7eb9aad290ca ]--- RIP: 0010:0x0 Code: Bad RIP value. RSP: 0000:ffff8881f6e09d30 EFLAGS: 00010202 RAX: ffffffff8151cbb9 RBX: 0000000000000101 RCX: ffff8881ed552f40 RDX: 0000000000000101 RSI: 0000000000000000 RDI: ffff8881ca7c71c0 RBP: ffff8881ca7c71e0 R08: ffffffff8151c992 R09: fffffbfff0d7370d R10: fffffbfff0d7370d R11: 1ffffffff0d7370c R12: 00000000ffffa4a0 R13: 1ffff1103edc92f1 R14: 0000000000000000 R15: ffff8881ca7c71c0 FS: 00007f0c0db35700(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001ca4ff000 CR4: 00000000003406f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 ---------------- Code disassembly (best guess): 0: 08 00 or %al,(%rax) 2: 74 0c je 0x10 4: 48 c7 c7 d0 cd aa 85 mov $0xffffffff85aacdd0,%rdi b: e8 55 15 6d fd callq 0xfd6d1565 10: 48 83 3d 2d d8 8a 01 cmpq $0x0,0x18ad82d(%rip) # 0x18ad845 17: 00 18: 74 29 je 0x43 1a: 48 89 df mov %rbx,%rdi 1d: e8 43 87 29 fd callq 0xfd298765 22: 66 90 xchg %ax,%ax 24: fb sti 25: bf 01 00 00 00 mov $0x1,%edi * 2a: e8 66 f9 22 fd callq 0xfd22f995 <-- trapping instruction 2f: 65 8b 05 cb 97 e2 7b mov %gs:0x7be297cb(%rip),%eax # 0x7be29801 36: 85 c0 test %eax,%eax 38: 74 02 je 0x3c 3a: 5b pop %rbx 3b: c3 retq 3c: e8 .byte 0xe8 3d: 34 4c xor $0x4c,%al 3f: e0 .byte 0xe0