==================================================================
BUG: KASAN: use-after-free in hlist_add_head include/linux/list.h:814 [inline]
BUG: KASAN: use-after-free in enqueue_timer+0x9e/0x2c0 kernel/time/timer.c:541
Write of size 8 at addr ffff8881da8531c8 by task syz-executor/1589
CPU: 0 PID: 1589 Comm: syz-executor Tainted: G W 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
Call Trace:
__dump_stack+0x1e/0x20 lib/dump_stack.c:77
dump_stack+0x15b/0x1b8 lib/dump_stack.c:118
print_address_description+0x8d/0x4c0 mm/kasan/report.c:384
__kasan_report+0xef/0x120 mm/kasan/report.c:516
kasan_report+0x30/0x60 mm/kasan/common.c:653
__asan_report_store8_noabort+0x17/0x20 mm/kasan/generic_report.c:137
hlist_add_head include/linux/list.h:814 [inline]
enqueue_timer+0x9e/0x2c0 kernel/time/timer.c:541
__internal_add_timer kernel/time/timer.c:554 [inline]
internal_add_timer+0x208/0x3e0 kernel/time/timer.c:604
__mod_timer+0x5ab/0x1150 kernel/time/timer.c:1065
mod_timer+0x1f/0x30 kernel/time/timer.c:1117
can_stat_update+0xbab/0xc40 net/can/proc.c:186
call_timer_fn+0x3c/0x380 kernel/time/timer.c:1448
expire_timers kernel/time/timer.c:1493 [inline]
__run_timers+0x81d/0xb60 kernel/time/timer.c:1817
run_timer_softirq+0x6a/0xf0 kernel/time/timer.c:1830
__do_softirq+0x236/0x660 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x197/0x1c0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:539 [inline]
smp_apic_timer_interrupt+0x11d/0x490 arch/x86/kernel/apic/apic.c:1161
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834
RIP: 0010:__raw_spin_unlock_irqrestore include/linux/spinlock_api_smp.h:161 [inline]
RIP: 0010:_raw_spin_unlock_irqrestore+0x51/0x80 kernel/locking/spinlock.c:191
Code: 89 fe 48 c7 c7 b0 2d cb 85 e8 ab 7f 62 fd 4c 89 f7 48 83 3d 40 34 a0 01 00 74 34 e8 0d 38 1d fd 66 90 48 89 5d e8 ff 75 e8 9d 01 00 00 00 e8 e5 7a 16 fd 65 8b 05 fa 93 d7 7b 85 c0 74 09 48
RSP: 0018:ffff8881c80ef638 EFLAGS: 00000a06 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000001 RBX: 0000000000000a06 RCX: dffffc0000000000
RDX: 0000000000000000 RSI: 0000000000000a06 RDI: ffffffff862911c0
RBP: ffff8881c80ef650 R08: dffffc0000000000 R09: fffff94000e771c9
R10: fffff94000e771c9 R11: 1ffffd4000e771c8 R12: ffffea00073b8e48
R13: dffffc0000000000 R14: ffffffff862911c0 R15: 0000000000000070
spin_unlock_irqrestore include/linux/spinlock.h:393 [inline]
release_pages+0xa37/0xaa0 mm/swap.c:839
__pagevec_release+0xbb/0x140 mm/swap.c:862
pagevec_release include/linux/pagevec.h:88 [inline]
shmem_undo_range+0x7d8/0x1860 mm/shmem.c:875
shmem_truncate_range mm/shmem.c:997 [inline]
shmem_evict_inode+0x204/0x9a0 mm/shmem.c:1097
evict+0x465/0x880 fs/inode.c:610
iput_final fs/inode.c:1652 [inline]
iput+0x67d/0x810 fs/inode.c:1678
dentry_unlink_inode+0x2ca/0x370 fs/dcache.c:378
__dentry_kill+0x43e/0x640 fs/dcache.c:583
dentry_kill+0xc0/0x2a0 fs/dcache.c:677
dput+0x42/0x80 fs/dcache.c:864
__fput+0x4ba/0x730 fs/file_table.c:294
____fput+0x15/0x20 fs/file_table.c:314
task_work_run+0x146/0x170 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop+0x195/0x1b0 arch/x86/entry/common.c:163
prepare_exit_to_usermode+0x18e/0x1f0 arch/x86/entry/common.c:194
syscall_return_slowpath arch/x86/entry/common.c:274 [inline]
do_syscall_64+0x13e/0x170 arch/x86/entry/common.c:300
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7fe19ee4ac97
Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffdbaf6e6f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007fe19eecb89d RCX: 00007fe19ee4ac97
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffdbaf6e7b0
RBP: 00007ffdbaf6e7b0 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffdbaf6f840
R13: 00007fe19eecb89d R14: 0000000000026f94 R15: 00007ffdbaf6f880
Allocated by task 2616:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
__kasan_kmalloc+0x162/0x200 mm/kasan/common.c:529
kasan_kmalloc+0xd/0x20 mm/kasan/common.c:543
__kmalloc+0x12a/0x2f0 mm/slub.c:3913
kmalloc include/linux/slab.h:561 [inline]
copy_verifier_state+0xce/0xc20 kernel/bpf/verifier.c:724
push_stack+0x156/0x480 kernel/bpf/verifier.c:819
check_cond_jmp_op+0x5c3/0x17f0 kernel/bpf/verifier.c:6192
do_check+0x5058/0x8a60 kernel/bpf/verifier.c:8109
bpf_check+0x208a/0x9cf0 kernel/bpf/verifier.c:9637
bpf_prog_load+0xa5f/0xe10 kernel/bpf/syscall.c:1724
__do_sys_bpf kernel/bpf/syscall.c:2891 [inline]
__se_sys_bpf+0x435/0x570 kernel/bpf/syscall.c:2849
__x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:2849
do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
Freed by task 2616:
save_stack mm/kasan/common.c:70 [inline]
set_track mm/kasan/common.c:78 [inline]
kasan_set_free_info mm/kasan/common.c:345 [inline]
__kasan_slab_free+0x1c3/0x280 mm/kasan/common.c:487
kasan_slab_free+0xe/0x10 mm/kasan/common.c:496
slab_free_hook mm/slub.c:1455 [inline]
slab_free_freelist_hook+0xb7/0x180 mm/slub.c:1494
slab_free mm/slub.c:3080 [inline]
kfree+0xbe/0x260 mm/slub.c:4071
clear_jmp_history kernel/bpf/verifier.c:677 [inline]
free_verifier_state+0x1a3/0x220 kernel/bpf/verifier.c:691
pop_stack kernel/bpf/verifier.c:795 [inline]
do_check+0x65d1/0x8a60 kernel/bpf/verifier.c:8098
bpf_check+0x208a/0x9cf0 kernel/bpf/verifier.c:9637
bpf_prog_load+0xa5f/0xe10 kernel/bpf/syscall.c:1724
__do_sys_bpf kernel/bpf/syscall.c:2891 [inline]
__se_sys_bpf+0x435/0x570 kernel/bpf/syscall.c:2849
__x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:2849
do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
The buggy address belongs to the object at ffff8881da853000
which belongs to the cache kmalloc-512 of size 512
The buggy address is located 456 bytes inside of
512-byte region [ffff8881da853000, ffff8881da853200)
The buggy address belongs to the page:
page:ffffea00076a1400 refcount:1 mapcount:0 mapping:ffff8881f5c02500 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c02500
raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 2, migratetype Unmovable, gfp_mask 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL)
set_page_owner include/linux/page_owner.h:31 [inline]
post_alloc_hook mm/page_alloc.c:2165 [inline]
prep_new_page+0x35e/0x370 mm/page_alloc.c:2171
get_page_from_freelist+0x1296/0x1310 mm/page_alloc.c:3794
__alloc_pages_nodemask+0x202/0x4b0 mm/page_alloc.c:4894
alloc_slab_page+0x3c/0x3b0 mm/slub.c:343
allocate_slab mm/slub.c:1683 [inline]
new_slab+0x93/0x420 mm/slub.c:1749
new_slab_objects mm/slub.c:2505 [inline]
___slab_alloc+0x29e/0x420 mm/slub.c:2667
__slab_alloc+0x63/0xa0 mm/slub.c:2707
slab_alloc_node mm/slub.c:2792 [inline]
slab_alloc mm/slub.c:2837 [inline]
__kmalloc+0x176/0x2f0 mm/slub.c:3909
kmalloc include/linux/slab.h:561 [inline]
copy_verifier_state+0xce/0xc20 kernel/bpf/verifier.c:724
pop_stack kernel/bpf/verifier.c:786 [inline]
do_check+0x6530/0x8a60 kernel/bpf/verifier.c:8098
bpf_check+0x208a/0x9cf0 kernel/bpf/verifier.c:9637
bpf_prog_load+0xa5f/0xe10 kernel/bpf/syscall.c:1724
__do_sys_bpf kernel/bpf/syscall.c:2891 [inline]
__se_sys_bpf+0x435/0x570 kernel/bpf/syscall.c:2849
__x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:2849
do_syscall_64+0xcf/0x170 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+0x2a9/0x3a0 mm/page_alloc.c:3085
free_unref_page_list+0x110/0x4c0 mm/page_alloc.c:3154
release_pages+0xa62/0xaa0 mm/swap.c:842
free_pages_and_swap_cache+0x86/0xa0 mm/swap_state.c:297
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+0x175/0x300 mm/mmu_gather.c:277
exit_mmap+0x2db/0x520 mm/mmap.c:3193
__mmput+0x92/0x2e0 kernel/fork.c:1101
mmput+0x47/0x60 kernel/fork.c:1122
exit_mm kernel/exit.c:538 [inline]
do_exit+0x99f/0x2660 kernel/exit.c:848
do_group_exit+0x13e/0x300 kernel/exit.c:984
__do_sys_exit_group kernel/exit.c:995 [inline]
__se_sys_exit_group kernel/exit.c:993 [inline]
__x64_sys_exit_group+0x3f/0x40 kernel/exit.c:993
do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
Memory state around the buggy address:
ffff8881da853080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff8881da853100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff8881da853180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff8881da853200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881da853280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
kasan: CONFIG_KASAN_INLINE enabled
kasan: GPF could be caused by NULL-ptr deref or user memory access
general protection fault: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 1589 Comm: syz-executor Tainted: G B W 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:__hlist_del include/linux/list.h:791 [inline]
RIP: 0010:detach_timer kernel/time/timer.c:824 [inline]
RIP: 0010:expire_timers kernel/time/timer.c:1482 [inline]
RIP: 0010:__run_timers+0x74b/0xb60 kernel/time/timer.c:1817
Code: 89 ef e8 88 d8 3c 00 4d 89 65 00 4d 85 e4 74 2e e8 aa dd 0e 00 49 83 c4 08 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 e7 e8 57 d8 3c 00 4d 89 2c 24 eb 05 e8 7c
RSP: 0018:ffff8881f6e09d40 EFLAGS: 00010003
RAX: 0000000040000002 RBX: 1ffff1103b50a639 RCX: dffffc0000000000
RDX: 0000000000000101 RSI: 0000000000000008 RDI: ffff8881da8531c8
RBP: ffff8881f6e09eb8 R08: 0000000000000004 R09: 0000000000000003
R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 0000000200000015
R13: ffff8881f6e09e00 R14: ffff8881da8531c8 R15: 1ffff1103b50a638
FS: 0000555583eea500(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff84ad8628 CR3: 00000001c80d6000 CR4: 00000000003426b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
run_timer_softirq+0x6a/0xf0 kernel/time/timer.c:1830
__do_softirq+0x236/0x660 kernel/softirq.c:292
invoke_softirq kernel/softirq.c:373 [inline]
irq_exit+0x197/0x1c0 kernel/softirq.c:413
exiting_irq arch/x86/include/asm/apic.h:539 [inline]
smp_apic_timer_interrupt+0x11d/0x490 arch/x86/kernel/apic/apic.c:1161
apic_timer_interrupt+0xf/0x20 arch/x86/entry/entry_64.S:834
RIP: 0010:on_stack arch/x86/include/asm/stacktrace.h:43 [inline]
RIP: 0010:update_stack_state+0x1a2/0x4c0 arch/x86/kernel/unwind_frame.c:224
Code: ff e8 42 28 f8 ff 85 c0 0f 85 2f 01 00 00 48 8b 85 30 ff ff ff 42 80 3c 28 00 74 08 4c 89 f7 e8 64 d4 5f 00 4d 89 f4 4d 8b 3e <48> 8b 85 38 ff ff ff 42 80 3c 28 00 74 0c 48 8b bd 58 ff ff ff e8
RSP: 0018:ffff8881c80ef0d8 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: 1ffff1103901de4a RBX: ffff8881c80ef248 RCX: 1ffff1103901de4b
RDX: 1ffff1103901de4c RSI: 1ffff1103901de4a RDI: ffff8881c80ef2a0
RBP: ffff8881c80ef1a8 R08: dffffc0000000000 R09: ffff8881c80ef248
R10: ffffed103901de55 R11: 1ffff1103901de49 R12: ffff8881c80ef250
R13: dffffc0000000000 R14: ffff8881c80ef250 R15: ffff8881c80e8000
unwind_next_frame+0x3f7/0x760 arch/x86/kernel/unwind_frame.c:311
arch_stack_walk+0x10c/0x140 arch/x86/kernel/stacktrace.c:25
stack_trace_save+0xaa/0xf0 kernel/stacktrace.c:123
save_stack+0x97/0x560 mm/page_owner.c:122
__reset_page_owner+0x23/0x110 mm/page_owner.c:149
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+0x2a9/0x3a0 mm/page_alloc.c:3085
free_unref_page_list+0x110/0x4c0 mm/page_alloc.c:3154
release_pages+0xa62/0xaa0 mm/swap.c:842
__pagevec_release+0xbb/0x140 mm/swap.c:862
pagevec_release include/linux/pagevec.h:88 [inline]
shmem_undo_range+0x7d8/0x1860 mm/shmem.c:875
shmem_truncate_range mm/shmem.c:997 [inline]
shmem_evict_inode+0x204/0x9a0 mm/shmem.c:1097
evict+0x465/0x880 fs/inode.c:610
iput_final fs/inode.c:1652 [inline]
iput+0x67d/0x810 fs/inode.c:1678
dentry_unlink_inode+0x2ca/0x370 fs/dcache.c:378
__dentry_kill+0x43e/0x640 fs/dcache.c:583
dentry_kill+0xc0/0x2a0 fs/dcache.c:677
dput+0x42/0x80 fs/dcache.c:864
__fput+0x4ba/0x730 fs/file_table.c:294
____fput+0x15/0x20 fs/file_table.c:314
task_work_run+0x146/0x170 kernel/task_work.c:113
tracehook_notify_resume include/linux/tracehook.h:188 [inline]
exit_to_usermode_loop+0x195/0x1b0 arch/x86/entry/common.c:163
prepare_exit_to_usermode+0x18e/0x1f0 arch/x86/entry/common.c:194
syscall_return_slowpath arch/x86/entry/common.c:274 [inline]
do_syscall_64+0x13e/0x170 arch/x86/entry/common.c:300
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7fe19ee4ac97
Code: a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 01 c3 48 c7 c2 a8 ff ff ff f7 d8 64 89 02 b8
RSP: 002b:00007ffdbaf6e6f8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6
RAX: 0000000000000000 RBX: 00007fe19eecb89d RCX: 00007fe19ee4ac97
RDX: 0000000000000000 RSI: 0000000000000009 RDI: 00007ffdbaf6e7b0
RBP: 00007ffdbaf6e7b0 R08: 0000000000000000 R09: 0000000000000000
R10: 00000000ffffffff R11: 0000000000000246 R12: 00007ffdbaf6f840
R13: 00007fe19eecb89d R14: 0000000000026f94 R15: 00007ffdbaf6f880
Modules linked in:
---[ end trace e139226ab651cdba ]---
RIP: 0010:__hlist_del include/linux/list.h:791 [inline]
RIP: 0010:detach_timer kernel/time/timer.c:824 [inline]
RIP: 0010:expire_timers kernel/time/timer.c:1482 [inline]
RIP: 0010:__run_timers+0x74b/0xb60 kernel/time/timer.c:1817
Code: 89 ef e8 88 d8 3c 00 4d 89 65 00 4d 85 e4 74 2e e8 aa dd 0e 00 49 83 c4 08 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df <80> 3c 08 00 74 08 4c 89 e7 e8 57 d8 3c 00 4d 89 2c 24 eb 05 e8 7c
RSP: 0018:ffff8881f6e09d40 EFLAGS: 00010003
RAX: 0000000040000002 RBX: 1ffff1103b50a639 RCX: dffffc0000000000
RDX: 0000000000000101 RSI: 0000000000000008 RDI: ffff8881da8531c8
RBP: ffff8881f6e09eb8 R08: 0000000000000004 R09: 0000000000000003
R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 0000000200000015
R13: ffff8881f6e09e00 R14: ffff8881da8531c8 R15: 1ffff1103b50a638
FS: 0000555583eea500(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fff84ad8628 CR3: 00000001c80d6000 CR4: 00000000003426b0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
0: 89 fe mov %edi,%esi
2: 48 c7 c7 b0 2d cb 85 mov $0xffffffff85cb2db0,%rdi
9: e8 ab 7f 62 fd call 0xfd627fb9
e: 4c 89 f7 mov %r14,%rdi
11: 48 83 3d 40 34 a0 01 cmpq $0x0,0x1a03440(%rip) # 0x1a03459
18: 00
19: 74 34 je 0x4f
1b: e8 0d 38 1d fd call 0xfd1d382d
20: 66 90 xchg %ax,%ax
22: 48 89 5d e8 mov %rbx,-0x18(%rbp)
26: ff 75 e8 push -0x18(%rbp)
29: 9d popf
* 2a: bf 01 00 00 00 mov $0x1,%edi <-- trapping instruction
2f: e8 e5 7a 16 fd call 0xfd167b19
34: 65 8b 05 fa 93 d7 7b mov %gs:0x7bd793fa(%rip),%eax # 0x7bd79435
3b: 85 c0 test %eax,%eax
3d: 74 09 je 0x48
3f: 48 rex.W