==================================================================
BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:814 [inline]
BUG: KASAN: use-after-free in enqueue_timer+0xb7/0x300 kernel/time/timer.c:541
Write of size 8 at addr ffff8881d82df1c8 by task syz-executor.0/5425
CPU: 1 PID: 5425 Comm: syz-executor.0 Not tainted 5.4.274-syzkaller-00002-g6f97bd951d82 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
__dump_stack lib/dump_stack.c:77 [inline]
dump_stack+0x1d8/0x241 lib/dump_stack.c:118
print_address_description+0x8c/0x600 mm/kasan/report.c:384
__kasan_report+0xf3/0x120 mm/kasan/report.c:516
kasan_report+0x30/0x60 mm/kasan/common.c:653
hlist_add_head include/linux/list.h:814 [inline]
enqueue_timer+0xb7/0x300 kernel/time/timer.c:541
__internal_add_timer kernel/time/timer.c:554 [inline]
internal_add_timer+0x240/0x430 kernel/time/timer.c:604
__mod_timer+0x6f1/0x13e0 kernel/time/timer.c:1065
call_timer_fn+0x36/0x390 kernel/time/timer.c:1448
expire_timers kernel/time/timer.c:1493 [inline]
__run_timers+0x879/0xbe0 kernel/time/timer.c:1817
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1830
__do_softirq+0x23b/0x6b7 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+0x11a/0x460 arch/x86/kernel/apic/apic.c:1149
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834
RIP: 0010:__sanitizer_cov_trace_pc+0x31/0x50 kernel/kcov.c:192
Code: 0d 54 51 9e 7e 65 8b 15 59 51 9e 7e f7 c2 00 01 1f 00 74 01 c3 8b 91 00 0a 00 00 83 fa 02 75 f4 48 8b 91 08 0a 00 00 48 8b 32 <48> 8d 7e 01 8b 89 04 0a 00 00 48 39 cf 73 db 48 89 44 f2 08 48 89
RSP: 0018:ffff8881d0a16cd8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: ffffffff8223062c RBX: 0000000000000001 RCX: ffff8881f47e3f00
RDX: ffffc9000014e000 RSI: 000000000000cc33 RDI: 0000000000000000
RBP: ffff8881d0a16e30 R08: ffffffff82230618 R09: ffff8881eed0cc58
R10: 0000000000000000 R11: dffffc0000000001 R12: dffffc0000000000
R13: ffff8881d0a16ec0 R14: ffff8881d0a16dc0 R15: 1ffff1103a142dd8
blk_mq_dispatch_rq_list+0x13c/0x16f0 block/blk-mq.c:1267
blk_mq_do_dispatch_sched+0x389/0x480 block/blk-mq-sched.c:132
__blk_mq_sched_dispatch_requests+0x3d8/0x4d0 block/blk-mq-sched.c:235
blk_mq_sched_dispatch_requests+0xec/0x160 block/blk-mq-sched.c:266
__blk_mq_run_hw_queue+0x15f/0x270 block/blk-mq.c:1451
__blk_mq_delay_run_hw_queue+0x12b/0x5b0 block/blk-mq.c:1519
blk_mq_run_hw_queue+0x1d1/0x320 block/blk-mq.c:1556
blk_mq_sched_insert_requests+0x22b/0x380 block/blk-mq-sched.c:522
blk_mq_flush_plug_list+0x8b4/0xb00 block/blk-mq.c:1824
blk_flush_plug_list+0x47e/0x4d0 block/blk-core.c:1790
blk_finish_plug+0x59/0x80 block/blk-core.c:1807
ext4_writepages+0x1116/0x3cc0 fs/ext4/inode.c:3001
do_writepages+0x12b/0x270 mm/page-writeback.c:2344
__filemap_fdatawrite_range+0x33c/0x3f0 mm/filemap.c:421
file_write_and_wait_range+0x83/0x110 mm/filemap.c:782
ext4_sync_file+0x1ad/0xcc0 fs/ext4/fsync.c:126
generic_write_sync include/linux/fs.h:2973 [inline]
ext4_file_write_iter+0xa03/0x10e0 fs/ext4/file.c:281
call_write_iter include/linux/fs.h:1989 [inline]
new_sync_write fs/read_write.c:483 [inline]
__vfs_write+0x5d3/0x750 fs/read_write.c:496
vfs_write+0x206/0x4e0 fs/read_write.c:558
ksys_write+0x199/0x2c0 fs/read_write.c:611
do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7f69222080a9
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f69215820c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007f692233ef80 RCX: 00007f69222080a9
RDX: 000000000000ffe6 RSI: 0000000020000040 RDI: 000000000000000a
RBP: 00007f6922277074 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 000000000000000b R14: 00007f692233ef80 R15: 00007fffc9192c38
The buggy address belongs to the page:
page:ffffea000760b7c0 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0
flags: 0x8000000000000000()
raw: 8000000000000000 ffffea0007a0a308 ffffea0007548bc8 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffff7f 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+0x18f/0x370 mm/page_alloc.c:2171
get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794
__alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4893
__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+0x1bb/0xd00 mm/percpu-vm.c:284
pcpu_alloc+0x79e/0x1050 mm/percpu.c:1714
bpf_array_alloc_percpu kernel/bpf/arraymap.c:35 [inline]
array_map_alloc+0x38c/0x6d0 kernel/bpf/arraymap.c:133
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:2873 [inline]
__se_sys_bpf+0x3291/0xbcb0 kernel/bpf/syscall.c:2849
do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
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 mm/page_alloc.c:1233 [inline]
free_unref_page_prepare+0x297/0x380 mm/page_alloc.c:3085
free_unref_page mm/page_alloc.c:3134 [inline]
free_the_page mm/page_alloc.c:4953 [inline]
__free_pages+0xaf/0x140 mm/page_alloc.c:4961
pcpu_free_pages mm/percpu-vm.c:64 [inline]
pcpu_depopulate_chunk mm/percpu-vm.c:328 [inline]
pcpu_balance_workfn+0x940/0x1450 mm/percpu.c:1865
process_one_work+0x765/0xd20 kernel/workqueue.c:2290
worker_thread+0xaef/0x1470 kernel/workqueue.c:2436
kthread+0x2da/0x360 kernel/kthread.c:288
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354
Memory state around the buggy address:
ffff8881d82df080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881d82df100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881d82df180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881d82df200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881d82df280: 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 0 P4D 0
Oops: 0010 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 3882 Comm: syz-executor.0 Tainted: G B 5.4.274-syzkaller-00002-g6f97bd951d82 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:0x0
Code: Bad RIP value.
RSP: 0018:ffff8881f6f09d18 EFLAGS: 00010206
RAX: ffffffff8154d7aa RBX: 0000000000000100 RCX: ffff8881e63f0fc0
RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881d82df1c0
RBP: ffff8881f6f09ec8 R08: ffffffff8154d3ee R09: 0000000000000003
R10: ffffffffffffffff R11: dffffc0000000001 R12: 00000000ffffa8e8
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881d82df1c0
FS: 0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 0000000005e0e000 CR4: 00000000003406a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
call_timer_fn+0x36/0x390 kernel/time/timer.c:1448
expire_timers kernel/time/timer.c:1493 [inline]
__run_timers+0x879/0xbe0 kernel/time/timer.c:1817
run_timer_softirq+0x63/0xf0 kernel/time/timer.c:1830
__do_softirq+0x23b/0x6b7 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+0x11a/0x460 arch/x86/kernel/apic/apic.c:1149
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834
RIP: 0010:check_memory_region+0x1/0x280 mm/kasan/generic.c:190
Code: 5b 41 5c 41 5d 41 5e 41 5f 5d c3 48 c7 c7 63 84 59 85 eb 0a 48 c7 c7 9b 84 59 85 4c 89 fe e8 4c 80 bb 02 31 db eb d7 90 90 55 <41> 57 41 56 53 b0 01 48 85 f6 0f 84 8e 01 00 00 48 89 fd 48 c1 ed
RSP: 0018:ffff8881e95e7800 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: ffffffff8191c5b0 RBX: ffffea0007bc8580 RCX: ffffffff8191c5c0
RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffffea0007bc8580
RBP: ffffea0007bc8580 R08: ffffffff8191c5a2 R09: fffff94000eea709
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffea0007bc8580
R13: dffffc0000000000 R14: ffffea0007bc8588 R15: 1ffffd4000f790b1
test_bit include/asm-generic/bitops-instrumented.h:237 [inline]
PageSwapBacked include/linux/page-flags.h:340 [inline]
PageSwapCache include/linux/page-flags.h:385 [inline]
free_swap_cache+0xa0/0x210 mm/swap_state.c:268
free_pages_and_swap_cache+0x5e/0x90 mm/swap_state.c:296
tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
tlb_flush_mmu_free mm/mmu_gather.c:189 [inline]
tlb_flush_mmu mm/mmu_gather.c:196 [inline]
tlb_finish_mmu+0x177/0x320 mm/mmu_gather.c:277
exit_mmap+0x2dc/0x520 mm/mmap.c:3193
__mmput+0x8e/0x2c0 kernel/fork.c:1101
exit_mm kernel/exit.c:536 [inline]
do_exit+0xc08/0x2bc0 kernel/exit.c:846
do_group_exit+0x138/0x300 kernel/exit.c:982
get_signal+0xdb1/0x1440 kernel/signal.c:2735
do_signal+0xb0/0x11f0 arch/x86/kernel/signal.c:809
exit_to_usermode_loop+0xc0/0x1a0 arch/x86/entry/common.c:159
prepare_exit_to_usermode+0x199/0x200 arch/x86/entry/common.c:194
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7f6922233473
Code: Bad RIP value.
RSP: 002b:00007fffc9192eb8 EFLAGS: 00000202 ORIG_RAX: 00000000000000e6
RAX: 0000000000000000 RBX: 0000000000000131 RCX: 00007f6922233473
RDX: 00007fffc9192ed0 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 00007fffc9192f4c R08: 00007fffc91e1080 R09: 00007fffc91e10b0
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000032
R13: 00000000000130db R14: 00000000000130c7 R15: 000000000000000e
Modules linked in:
CR2: 0000000000000000
---[ end trace 54a656115e090025 ]---
RIP: 0010:0x0
Code: Bad RIP value.
RSP: 0018:ffff8881f6f09d18 EFLAGS: 00010206
RAX: ffffffff8154d7aa RBX: 0000000000000100 RCX: ffff8881e63f0fc0
RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881d82df1c0
RBP: ffff8881f6f09ec8 R08: ffffffff8154d3ee R09: 0000000000000003
R10: ffffffffffffffff R11: dffffc0000000001 R12: 00000000ffffa8e8
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881d82df1c0
FS: 0000000000000000(0000) GS:ffff8881f6f00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 0000000005e0e000 CR4: 00000000003406a0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 0d 54 51 9e 7e or $0x7e9e5154,%eax
5: 65 8b 15 59 51 9e 7e mov %gs:0x7e9e5159(%rip),%edx # 0x7e9e5165
c: f7 c2 00 01 1f 00 test $0x1f0100,%edx
12: 74 01 je 0x15
14: c3 ret
15: 8b 91 00 0a 00 00 mov 0xa00(%rcx),%edx
1b: 83 fa 02 cmp $0x2,%edx
1e: 75 f4 jne 0x14
20: 48 8b 91 08 0a 00 00 mov 0xa08(%rcx),%rdx
27: 48 8b 32 mov (%rdx),%rsi
* 2a: 48 8d 7e 01 lea 0x1(%rsi),%rdi <-- trapping instruction
2e: 8b 89 04 0a 00 00 mov 0xa04(%rcx),%ecx
34: 48 39 cf cmp %rcx,%rdi
37: 73 db jae 0x14
39: 48 89 44 f2 08 mov %rax,0x8(%rdx,%rsi,8)
3e: 48 rex.W
3f: 89 .byte 0x89