================================================================== 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 ffff8881d4d0b1c8 by task syz.1.487/2135 CPU: 0 PID: 2135 Comm: syz.1.487 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:memset_erms+0x9/0x10 arch/x86/lib/memset_64.S:64 Code: c1 e9 03 40 0f b6 f6 48 b8 01 01 01 01 01 01 01 01 48 0f af c6 f3 48 ab 89 d1 f3 aa 4c 89 c8 c3 90 49 89 f9 40 88 f0 48 89 d1 aa 4c 89 c8 c3 90 49 89 fa 40 0f b6 ce 48 b8 01 01 01 01 01 01 RSP: 0018:ffff8881e3b2f4d8 EFLAGS: 00010246 ORIG_RAX: ffffffffffffff13 RAX: 0000000000001000 RBX: ffff8881e2648000 RCX: 0000000000000100 RDX: 0000000000000200 RSI: 0000000000000000 RDI: ffffed103c4c9100 RBP: ffff8881e3b2f738 R08: ffff8881d65b2000 R09: ffffed103c4c9000 R10: ffffed103c765ec0 R11: 1ffff1103c765ec0 R12: ffff8881e2648fff R13: 0000000000001000 R14: 1ffff1103c4c9200 R15: dffffc0000000000 kasan_slab_alloc+0x12/0x20 mm/kasan/common.c:537 slab_post_alloc_hook mm/slab.h:584 [inline] slab_alloc_node mm/slub.c:2829 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc_track_caller+0x10d/0x2d0 mm/slub.c:4449 __kmalloc_reserve net/core/skbuff.c:142 [inline] pskb_expand_head+0x123/0x1110 net/core/skbuff.c:1653 skb_ensure_writable+0x2e7/0x460 net/core/skbuff.c:5569 __bpf_try_make_writable net/core/filter.c:1635 [inline] bpf_try_make_writable net/core/filter.c:1641 [inline] bpf_try_make_head_writable net/core/filter.c:1649 [inline] ____bpf_clone_redirect net/core/filter.c:2145 [inline] bpf_clone_redirect+0x10b/0x380 net/core/filter.c:2123 bpf_prog_973cd02a7a0e8181+0x451/0x1000 bpf_call_func include/linux/filter.h:627 [inline] bpf_test_run+0x1ea/0x5d0 net/bpf/test_run.c:44 bpf_prog_test_run_skb+0x721/0xdc0 net/bpf/test_run.c:311 bpf_prog_test_run+0x21a/0x2a0 kernel/bpf/syscall.c:2124 __do_sys_bpf kernel/bpf/syscall.c:2909 [inline] __se_sys_bpf+0x49a/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 RIP: 0033:0x7f171ae05969 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:00007f171946e038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: ffffffffffffffda RBX: 00007f171b02cfa0 RCX: 00007f171ae05969 RDX: 000000000000002c RSI: 0000200000000080 RDI: 000000000000000a RBP: 00007f171ae87ab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f171b02cfa0 R15: 00007ffe35e846a8 The buggy address belongs to the page: page:ffffea00075342c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 dead000000000100 dead000000000122 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+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_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+0x1b6/0xce0 mm/percpu-vm.c:284 pcpu_alloc+0x8ec/0x1120 mm/percpu.c:1714 __alloc_percpu_gfp+0x25/0x30 mm/percpu.c:1783 prealloc_init+0x24b/0x810 kernel/bpf/hashtab.c:154 htab_map_alloc+0x65f/0x940 kernel/bpf/hashtab.c:385 find_and_alloc_map kernel/bpf/syscall.c:122 [inline] map_create+0x2d8/0x980 kernel/bpf/syscall.c:573 __do_sys_bpf kernel/bpf/syscall.c:2873 [inline] __se_sys_bpf+0x2dc/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 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: ffff8881d4d0b080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881d4d0b100: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881d4d0b180: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881d4d0b200: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881d4d0b280: 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.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: 00010202 RAX: ffffffff8150a590 RBX: 0000000000000101 RCX: ffffffff85c1ad40 RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881d4d0b1c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffa1e8 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881d4d0b1c0 FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001ed90f000 CR4: 00000000003406b0 DR0: 0000200000000300 DR1: 0000000000000000 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:default_idle+0x23/0x40 arch/x86/kernel/process.c:578 Code: 90 90 00 00 90 90 00 55 48 89 e5 e8 87 b2 f5 fd bf 01 00 00 00 89 c6 e8 bb 1c fc fc 0f 1f 44 00 00 0f 00 2d cf c2 59 00 fb f4 68 b2 f5 fd bf ff ff ff ff 89 c6 e8 9c 1c fc fc 5d c3 66 2e 0f RSP: 0018:ffffffff85c07cc0 EFLAGS: 000002c6 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: ffffffff85c1ad40 RCX: ffffffff85c1ad40 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000001 RBP: ffffffff85c07cc0 R08: dffffc0000000000 R09: fffffbfff0b835a9 R10: fffffbfff0b835a9 R11: 1ffffffff0b835a8 R12: 0000000000000000 R13: 1ffffffff0b835a8 R14: 0000000000000000 R15: ffffffff862bb528 arch_cpu_idle+0xa/0x10 arch/x86/kernel/process.c:568 default_idle_call kernel/sched/idle.c:94 [inline] cpuidle_idle_call kernel/sched/idle.c:154 [inline] do_idle+0x21d/0x550 kernel/sched/idle.c:264 cpu_startup_entry+0x18/0x20 kernel/sched/idle.c:356 rest_init+0xe8/0xf0 init/main.c:707 arch_call_rest_init+0xe/0x10 init/main.c:831 start_kernel+0x678/0x73e init/main.c:1036 x86_64_start_reservations+0x2a/0x2c arch/x86/kernel/head64.c:492 x86_64_start_kernel+0x60/0x63 arch/x86/kernel/head64.c:473 secondary_startup_64+0xa4/0xb0 arch/x86/kernel/head_64.S:241 Modules linked in: CR2: 0000000000000000 ---[ end trace 8189da9cc98a30b2 ]--- RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010202 RAX: ffffffff8150a590 RBX: 0000000000000101 RCX: ffffffff85c1ad40 RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881d4d0b1c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffa1e8 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881d4d0b1c0 FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001ed90f000 CR4: 00000000003406b0 DR0: 0000200000000300 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 ---------------- Code disassembly (best guess): 0: c1 e9 03 shr $0x3,%ecx 3: 40 0f b6 f6 movzbl %sil,%esi 7: 48 b8 01 01 01 01 01 movabs $0x101010101010101,%rax e: 01 01 01 11: 48 0f af c6 imul %rsi,%rax 15: f3 48 ab rep stos %rax,%es:(%rdi) 18: 89 d1 mov %edx,%ecx 1a: f3 aa rep stos %al,%es:(%rdi) 1c: 4c 89 c8 mov %r9,%rax 1f: c3 ret 20: 90 nop 21: 49 89 f9 mov %rdi,%r9 24: 40 88 f0 mov %sil,%al 27: 48 89 d1 mov %rdx,%rcx * 2a: f3 aa rep stos %al,%es:(%rdi) <-- trapping instruction 2c: 4c 89 c8 mov %r9,%rax 2f: c3 ret 30: 90 nop 31: 49 89 fa mov %rdi,%r10 34: 40 0f b6 ce movzbl %sil,%ecx 38: 48 rex.W 39: b8 01 01 01 01 mov $0x1010101,%eax 3e: 01 01 add %eax,(%rcx)