==================================================================
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 ffff8881cf29b1c8 by task syz.1.2895/9476
CPU: 0 PID: 9476 Comm: syz.1.2895 Not tainted 5.4.290-syzkaller-00002-g41adfeb3d639 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
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:539 [inline]
smp_apic_timer_interrupt+0x11a/0x490 arch/x86/kernel/apic/apic.c:1161
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834
RIP: 0010:do_user_addr_fault arch/x86/mm/fault.c:1367 [inline]
RIP: 0010:__do_page_fault+0x301/0xbb0 arch/x86/mm/fault.c:1505
Code: 81 fd 00 00 60 ff 75 22 4c 89 ff 48 8b 34 24 4c 89 f2 e8 32 63 d0 ff 84 c0 4c 8b 7c 24 30 74 16 e8 b4 1e 34 00 e9 24 04 00 00 aa 1e 34 00 4c 8b 7c 24 30 eb 05 e8 9e 1e 34 00 49 8d 7f 78 48
RSP: 0018:ffff8881e87df7d0 EFLAGS: 00000207 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000002 RBX: 0000000000000214 RCX: 0000000000080000
RDX: ffff8881ed830000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000200000030000 R08: ffffffff81302c26 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: 0000000000000000
R13: 0000000000000000 R14: 0000200000030000 R15: 0000000000000000
page_fault+0x2f/0x40 arch/x86/entry/entry_64.S:1206
RIP: 0010:fault_in_pages_readable include/linux/pagemap.h:596 [inline]
RIP: 0010:iov_iter_fault_in_readable+0x1db/0x4c0 lib/iov_iter.c:427
Code: 8b 4c 24 38 4d 8d 2c 0e 49 63 c4 4d 8d 7c 05 ff 4d 39 ef 0f 82 b8 01 00 00 4a 8d 9c 31 00 10 00 00 0f 01 cb 0f ae e8 45 31 e4 <45> 8a 75 00 0f 01 ca 48 b8 00 00 00 00 00 fc ff df 48 8b 4c 24 30
RSP: 0018:ffff8881e87df920 EFLAGS: 00050246
RAX: 0000000000001000 RBX: 0000200000031000 RCX: 0000000000030000
RDX: ffff8881ed830000 RSI: 0000000000001000 RDI: 0000000000000000
RBP: ffff8881e87df9f0 R08: ffffffff822b4622 R09: ffffffff822b81b6
R10: ffff8881ed830000 R11: 0000000000000002 R12: 0000000000000000
R13: 0000200000030000 R14: 0000200000000000 R15: 0000200000030fff
generic_perform_write+0x1ce/0x560 mm/filemap.c:3440
__generic_file_write_iter+0x224/0x530 mm/filemap.c:3579
generic_file_write_iter+0x455/0x5f0 mm/filemap.c:3611
call_write_iter include/linux/fs.h:1991 [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:0x7fbc391cb169
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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fbc37835038 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
RAX: ffffffffffffffda RBX: 00007fbc393e3fa0 RCX: 00007fbc391cb169
RDX: 00000000002a979d RSI: 0000200000000000 RDI: 0000000000000006
RBP: 00007fbc3924c2a0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007fbc393e3fa0 R15: 00007ffcfb0f9a48
The buggy address belongs to the page:
page:ffffea00073ca6c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
flags: 0x8000000000000000()
raw: 8000000000000000 ffffea0007a33708 ffffea00073ca688 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 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO)
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
__vmalloc_area_node mm/vmalloc.c:2431 [inline]
__vmalloc_node_range+0x384/0x710 mm/vmalloc.c:2499
vmalloc_user+0x70/0x80 mm/vmalloc.c:2629
kcov_mmap+0x28/0x120 kernel/kcov.c:450
call_mmap include/linux/fs.h:1996 [inline]
mmap_region+0x110d/0x16f0 mm/mmap.c:1812
do_mmap+0x822/0xd30 mm/mmap.c:1581
do_mmap_pgoff include/linux/mm.h:2480 [inline]
vm_mmap_pgoff+0x1b5/0x260 mm/util.c:528
ksys_mmap_pgoff+0x168/0x1e0 mm/mmap.c:1631
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
__vunmap+0x75b/0x890 mm/vmalloc.c:2260
kcov_mmap+0x8c/0x120 kernel/kcov.c:474
call_mmap include/linux/fs.h:1996 [inline]
mmap_region+0x110d/0x16f0 mm/mmap.c:1812
do_mmap+0x822/0xd30 mm/mmap.c:1581
do_mmap_pgoff include/linux/mm.h:2480 [inline]
vm_mmap_pgoff+0x1b5/0x260 mm/util.c:528
ksys_mmap_pgoff+0x168/0x1e0 mm/mmap.c:1631
do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
Memory state around the buggy address:
ffff8881cf29b080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881cf29b100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
>ffff8881cf29b180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
^
ffff8881cf29b200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
ffff8881cf29b280: 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: 0 PID: 0 Comm: swapper/0 Tainted: G B 5.4.290-syzkaller-00002-g41adfeb3d639 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:0x0
Code: Bad RIP value.
RSP: 0018:ffff8881f6e09d18 EFLAGS: 00010202
RAX: ffffffff8154e8ca RBX: 0000000000000101 RCX: ffffffff85e1adc0
RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881cf29b1c0
RBP: ffff8881f6e09ec8 R08: ffffffff8154e50e R09: 0000000000000003
R10: ffffffffffffffff R11: dffffc0000000001 R12: 00000001000011a0
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881cf29b1c0
FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 00000001f1ec7000 CR4: 00000000003406b0
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:539 [inline]
smp_apic_timer_interrupt+0x11a/0x490 arch/x86/kernel/apic/apic.c:1161
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834
RIP: 0010:default_idle+0x1f/0x30 arch/x86/kernel/process.c:573
Code: 90 90 90 90 90 90 90 90 90 90 90 e8 8b af da fd bf 01 00 00 00 89 c6 e8 ef 93 d1 fc 0f 1f 44 00 00 0f 00 2d 23 a3 4d 00 fb f4 6c af da fd bf ff ff ff ff 89 c6 e9 d0 93 d1 fc 41 57 41 56 53
RSP: 0018:ffffffff85e07d18 EFLAGS: 000002d2 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000000 RBX: dffffc0000000000 RCX: ffffffff85e1adc0
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001
RBP: ffffffff85e07e20 R08: ffffffff8231cd01 R09: fffffbfff0bc35b9
R10: 0000000000000000 R11: dffffc0000000001 R12: ffffffff864c4d68
R13: ffffffff85e1adc0 R14: 1ffffffff0bc35b8 R15: 0000000000000000
default_idle_call kernel/sched/idle.c:94 [inline]
cpuidle_idle_call kernel/sched/idle.c:154 [inline]
do_idle+0x248/0x660 kernel/sched/idle.c:264
cpu_startup_entry+0x14/0x20 kernel/sched/idle.c:356
start_kernel+0x6d9/0x81d init/main.c:1036
secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241
Modules linked in:
CR2: 0000000000000000
---[ end trace 8c2462f3cef49961 ]---
RIP: 0010:0x0
Code: Bad RIP value.
RSP: 0018:ffff8881f6e09d18 EFLAGS: 00010202
RAX: ffffffff8154e8ca RBX: 0000000000000101 RCX: ffffffff85e1adc0
RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881cf29b1c0
RBP: ffff8881f6e09ec8 R08: ffffffff8154e50e R09: 0000000000000003
R10: ffffffffffffffff R11: dffffc0000000001 R12: 00000001000011a0
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881cf29b1c0
FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 00000001f1ec7000 CR4: 00000000003406b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 81 fd 00 00 60 ff cmp $0xff600000,%ebp
6: 75 22 jne 0x2a
8: 4c 89 ff mov %r15,%rdi
b: 48 8b 34 24 mov (%rsp),%rsi
f: 4c 89 f2 mov %r14,%rdx
12: e8 32 63 d0 ff call 0xffd06349
17: 84 c0 test %al,%al
19: 4c 8b 7c 24 30 mov 0x30(%rsp),%r15
1e: 74 16 je 0x36
20: e8 b4 1e 34 00 call 0x341ed9
25: e9 24 04 00 00 jmp 0x44e
* 2a: e8 aa 1e 34 00 call 0x341ed9 <-- trapping instruction
2f: 4c 8b 7c 24 30 mov 0x30(%rsp),%r15
34: eb 05 jmp 0x3b
36: e8 9e 1e 34 00 call 0x341ed9
3b: 49 8d 7f 78 lea 0x78(%r15),%rdi
3f: 48 rex.W