==================================================================
BUG: KASAN: slab-out-of-bounds in hlist_add_head include/linux/list.h:814 [inline]
BUG: KASAN: slab-out-of-bounds in enqueue_timer+0x9e/0x2c0 kernel/time/timer.c:541
Write of size 8 at addr ffff8881e30371c8 by task syz.2.594/2091
CPU: 0 PID: 2091 Comm: syz.2.594 Not tainted 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:freelist_ptr mm/slub.c:265 [inline]
RIP: 0010:freelist_dereference mm/slub.c:276 [inline]
RIP: 0010:get_freepointer mm/slub.c:282 [inline]
RIP: 0010:get_freepointer_safe mm/slub.c:296 [inline]
RIP: 0010:slab_alloc_node mm/slub.c:2795 [inline]
RIP: 0010:slab_alloc mm/slub.c:2837 [inline]
RIP: 0010:kmem_cache_alloc+0x93/0x270 mm/slub.c:2842
Code: 50 08 75 e5 4c 8b 38 4d 85 ff 0f 84 a4 00 00 00 48 83 78 10 00 0f 84 99 00 00 00 41 8b 45 20 49 8d 0c 07 49 8b 9d b0 01 00 00 <48> 0f c9 49 33 1c 07 48 31 cb 48 89 d1 48 83 c1 08 49 8b 7d 00 4c
RSP: 0018:ffff8881ebbd7d10 EFLAGS: 00000286 ORIG_RAX: ffffffffffffff13
RAX: 0000000000000000 RBX: 150cf361c07a9c9e RCX: ffff8881e9582200
RDX: 000000000005fcc8 RSI: 000000000000000e RDI: 000000000000000f
RBP: ffff8881ebbd7d40 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff8881f5d00a00
R13: ffff8881f5d00a00 R14: 0000000000000cc0 R15: ffff8881e9582200
getname_flags+0xb9/0x500 fs/namei.c:141
getname+0x19/0x20 fs/namei.c:212
do_sys_open+0x26c/0x5d0 fs/open.c:1117
__do_sys_openat fs/open.c:1150 [inline]
__se_sys_openat fs/open.c:1144 [inline]
__x64_sys_openat+0xa2/0xb0 fs/open.c:1144
do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290
entry_SYSCALL_64_after_hwframe+0x5c/0xc1
RIP: 0033:0x7f7bef632969
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:00007f7bedc7a038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101
RAX: ffffffffffffffda RBX: 00007f7bef85a080 RCX: 00007f7bef632969
RDX: 000000000000275a RSI: 0000200000000040 RDI: ffffffffffffff9c
RBP: 00007f7bef6b4ab1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 0000000000000000 R14: 00007f7bef85a080 R15: 00007ffef3de4cc8
Allocated by task 2064:
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_array include/linux/slab.h:618 [inline]
realloc_stack_state kernel/bpf/verifier.c:595 [inline]
realloc_func_state+0x305/0x5b0 kernel/bpf/verifier.c:611
copy_func_state kernel/bpf/verifier.c:704 [inline]
copy_verifier_state+0x65f/0xc20 kernel/bpf/verifier.c:751
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 2064:
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
free_func_state kernel/bpf/verifier.c:671 [inline]
free_verifier_state+0xd6/0x220 kernel/bpf/verifier.c:688
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 ffff8881e3034000
which belongs to the cache kmalloc-8k of size 8192
The buggy address is located 4552 bytes to the right of
8192-byte region [ffff8881e3034000, ffff8881e3036000)
The buggy address belongs to the page:
page:ffffea00078c0c00 refcount:1 mapcount:0 mapping:ffff8881f5c0c500 index:0x0 compound_mapcount: 0
flags: 0x8000000000010200(slab|head)
raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5c0c500
raw: 0000000000000000 0000000000020002 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
page_owner tracks the page as allocated
page last allocated via order 3, 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_array include/linux/slab.h:618 [inline]
realloc_stack_state kernel/bpf/verifier.c:595 [inline]
realloc_func_state+0x305/0x5b0 kernel/bpf/verifier.c:611
copy_func_state kernel/bpf/verifier.c:704 [inline]
copy_verifier_state+0x65f/0xc20 kernel/bpf/verifier.c:751
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
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 mm/page_alloc.c:3134 [inline]
free_the_page mm/page_alloc.c:4954 [inline]
__free_pages+0xaa/0x110 mm/page_alloc.c:4962
pcpu_free_pages mm/percpu-vm.c:64 [inline]
pcpu_depopulate_chunk mm/percpu-vm.c:328 [inline]
pcpu_balance_workfn+0x8c7/0x14b0 mm/percpu.c:1865
process_one_work+0x73b/0xcc0 kernel/workqueue.c:2290
worker_thread+0xa5c/0x13b0 kernel/workqueue.c:2436
kthread+0x31e/0x3a0 kernel/kthread.c:288
ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354
Memory state around the buggy address:
ffff8881e3037080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881e3037100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff8881e3037180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
^
ffff8881e3037200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff8881e3037280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================
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: 2080 Comm: syz.3.592 Tainted: G B 5.4.292-syzkaller-00021-gcd8e74fa0fa3 #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025
RIP: 0010:0x0
Code: Bad RIP value.
RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010206
RAX: ffffffff8150a590 RBX: 0000000000000100 RCX: ffff8881df53ee40
RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881e30371c0
RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003
R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffa5d0
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e30371c0
FS: 00007feab17c06c0(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 00000001f3bc1000 CR4: 00000000003406b0
DR0: 0000000000000000 DR1: 0000200000000300 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
Call Trace:
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:check_kcov_mode kernel/kcov.c:164 [inline]
RIP: 0010:__sanitizer_cov_trace_pc+0x27/0x50 kernel/kcov.c:187
Code: 90 90 00 55 48 89 e5 48 8b 45 08 65 48 8b 0d 90 0e a3 7e 65 8b 15 95 0e a3 7e f7 c2 00 01 1f 00 74 02 5d c3 8b 91 00 0a 00 00 <83> fa 02 75 f3 48 8b 91 08 0a 00 00 48 8b 32 48 8d 7e 01 8b 89 04
RSP: 0018:ffff8881e1527558 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13
RAX: ffffffff818b284f RBX: ffffea00075b5700 RCX: ffff8881df53ee40
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: ffff8881e1527558 R08: dffffc0000000000 R09: fffff94000eb6ad9
R10: fffff94000eb6ad9 R11: 1ffffd4000eb6ad8 R12: dead000000000100
R13: ffffea00075b5708 R14: 1ffffd4000eb6ae1 R15: ffffea00075b5700
compound_head include/linux/page-flags.h:176 [inline]
PageSwapBacked include/linux/page-flags.h:340 [inline]
PageSwapCache include/linux/page-flags.h:385 [inline]
free_swap_cache+0x9f/0x230 mm/swap_state.c:268
free_pages_and_swap_cache+0x60/0xa0 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+0xd6/0x180 mm/mmu_gather.c:196
zap_pte_range mm/memory.c:1173 [inline]
zap_pmd_range mm/memory.c:1222 [inline]
zap_pud_range mm/memory.c:1251 [inline]
zap_p4d_range mm/memory.c:1272 [inline]
unmap_page_range+0x1968/0x1b20 mm/memory.c:1293
unmap_single_vma mm/memory.c:1338 [inline]
unmap_vmas+0x245/0x340 mm/memory.c:1370
exit_mmap+0x2bb/0x520 mm/mmap.c:3191
__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
get_signal+0xdee/0x13d0 kernel/signal.c:2738
do_signal+0xad/0xda0 arch/x86/kernel/signal.c:809
exit_to_usermode_loop+0xc4/0x1b0 arch/x86/entry/common.c:159
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:0x7feab3157969
Code: Bad RIP value.
RSP: 002b:00007feab17c00e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca
RAX: fffffffffffffe00 RBX: 00007feab337efa8 RCX: 00007feab3157969
RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007feab337efa8
RBP: 00007feab337efa0 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007feab337efac
R13: 0000000000000000 R14: 00007ffc54b29a10 R15: 00007ffc54b29af8
Modules linked in:
CR2: 0000000000000000
---[ end trace 02f01db65df61f23 ]---
RIP: 0010:0x0
Code: Bad RIP value.
RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010206
RAX: ffffffff8150a590 RBX: 0000000000000100 RCX: ffff8881df53ee40
RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881e30371c0
RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003
R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffa5d0
R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e30371c0
FS: 00007feab17c06c0(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffffffffd6 CR3: 00000001f3bc1000 CR4: 00000000003406b0
DR0: 0000000000000000 DR1: 0000200000000300 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600
----------------
Code disassembly (best guess):
0: 50 push %rax
1: 08 75 e5 or %dh,-0x1b(%rbp)
4: 4c 8b 38 mov (%rax),%r15
7: 4d 85 ff test %r15,%r15
a: 0f 84 a4 00 00 00 je 0xb4
10: 48 83 78 10 00 cmpq $0x0,0x10(%rax)
15: 0f 84 99 00 00 00 je 0xb4
1b: 41 8b 45 20 mov 0x20(%r13),%eax
1f: 49 8d 0c 07 lea (%r15,%rax,1),%rcx
23: 49 8b 9d b0 01 00 00 mov 0x1b0(%r13),%rbx
* 2a: 48 0f c9 bswap %rcx <-- trapping instruction
2d: 49 33 1c 07 xor (%r15,%rax,1),%rbx
31: 48 31 cb xor %rcx,%rbx
34: 48 89 d1 mov %rdx,%rcx
37: 48 83 c1 08 add $0x8,%rcx
3b: 49 8b 7d 00 mov 0x0(%r13),%rdi
3f: 4c rex.WR