================================================================== 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 ffff8881eac7b1c8 by task syz.3.963/3788 CPU: 0 PID: 3788 Comm: syz.3.963 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:jhash2 include/linux/jhash.h:126 [inline] RIP: 0010:hash_stack lib/stackdepot.c:156 [inline] RIP: 0010:stack_depot_save+0x56/0x4c0 lib/stackdepot.c:237 Code: 57 01 00 00 41 89 f7 49 89 fe 43 8d 3c 3f 46 8d 24 fd 7b 71 f5 75 83 ff 04 0f 82 87 00 00 00 45 89 e3 44 89 e1 4c 89 f6 03 0e <44> 03 5e 04 44 03 66 08 45 89 e0 41 c1 c0 04 44 29 e1 41 31 c8 45 RSP: 0018:ffff8881e0b870c0 EFLAGS: 00000293 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: ffff8881e0b87160 RCX: 00000000a8c5f9e5 RDX: 0000000000102800 RSI: ffff8881e0b871cc RDI: 0000000000000005 RBP: ffff8881e0b87110 R08: 00000000707c41a7 R09: 000000001414d234 R10: 00000000ea802bc8 R11: 0000000035f354dd R12: 00000000385584b0 R13: dffffc0000000000 R14: ffff8881e0b87160 R15: 0000000000000010 save_stack+0x115/0x560 mm/page_owner.c:135 __set_page_owner+0x39/0x1e0 mm/page_owner.c:191 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] __get_free_pages+0xe/0x30 mm/page_alloc.c:4938 tlb_next_batch mm/mmu_gather.c:29 [inline] __tlb_remove_page_size+0x17b/0x300 mm/mmu_gather.c:83 __tlb_remove_page include/asm-generic/tlb.h:426 [inline] zap_pte_range mm/memory.c:1108 [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+0xf7c/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:0x7f11e8d5a969 Code: Bad RIP value. RSP: 002b:00007f11e73c3038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: fffffffffffffff5 RBX: 00007f11e8f81fa0 RCX: 00007f11e8d5a969 RDX: 0000000000000080 RSI: 0000200000000280 RDI: 0000000000000005 RBP: 00007f11e8ddcab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f11e8f81fa0 R15: 00007ffe98de6f98 Allocated by task 768: 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_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] kmem_cache_alloc+0xe2/0x270 mm/slub.c:2842 getname_flags+0xb9/0x500 fs/namei.c:141 getname fs/namei.c:212 [inline] user_path_mountpoint_at+0x28/0x50 fs/namei.c:2842 ksys_umount+0x147/0x360 fs/namespace.c:1690 __do_sys_umount fs/namespace.c:1716 [inline] __se_sys_umount fs/namespace.c:1714 [inline] __x64_sys_umount+0x5a/0x70 fs/namespace.c:1714 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 768: 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] kmem_cache_free+0x10c/0x2c0 mm/slub.c:3096 putname fs/namei.c:262 [inline] filename_mountpoint+0x43f/0x5c0 fs/namei.c:2820 user_path_mountpoint_at+0x39/0x50 fs/namei.c:2842 ksys_umount+0x147/0x360 fs/namespace.c:1690 __do_sys_umount fs/namespace.c:1716 [inline] __se_sys_umount fs/namespace.c:1714 [inline] __x64_sys_umount+0x5a/0x70 fs/namespace.c:1714 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 ffff8881eac7a200 which belongs to the cache names_cache of size 4096 The buggy address is located 4040 bytes inside of 4096-byte region [ffff8881eac7a200, ffff8881eac7b200) The buggy address belongs to the page: page:ffffea0007ab1e00 refcount:1 mapcount:0 mapping:ffff8881f5d00c80 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5d00c80 raw: 0000000000000000 0000000000070007 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] kmem_cache_alloc+0x12c/0x270 mm/slub.c:2842 getname_flags+0xb9/0x500 fs/namei.c:141 getname fs/namei.c:212 [inline] do_rmdir+0xcb/0x480 fs/namei.c:4055 __do_sys_unlinkat fs/namei.c:4252 [inline] __se_sys_unlinkat fs/namei.c:4246 [inline] __x64_sys_unlinkat+0xb6/0xe0 fs/namei.c:4246 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_pages_ok+0x7e4/0x910 mm/page_alloc.c:1438 free_the_page mm/page_alloc.c:4956 [inline] __free_pages+0x8c/0x110 mm/page_alloc.c:4962 kfree+0x1ca/0x260 mm/slub.c:4068 kvfree+0x4c/0x50 mm/util.c:625 bpf_check+0x8371/0x9cf0 kernel/bpf/verifier.c:9731 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 Memory state around the buggy address: ffff8881eac7b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881eac7b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881eac7b180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881eac7b200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881eac7b280: 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 1eb15d067 P4D 1eb15d067 PUD 0 Oops: 0010 [#1] PREEMPT SMP KASAN CPU: 0 PID: 3788 Comm: syz.3.963 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:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010202 RAX: ffffffff8150a590 RBX: 0000000000000101 RCX: ffff8881e1f95e80 RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881eac7b1c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffb318 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881eac7b1c0 FS: 00007f11e73c36c0(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001d640e000 CR4: 00000000003406b0 DR0: 0000000000000000 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:unlock_page_memcg+0x0/0xe0 mm/memcontrol.c:2167 Code: c3 28 05 00 00 48 89 df 4c 89 fe e8 aa a1 9a 02 e8 a5 df bd ff 5b 41 5c 41 5d 41 5e 41 5f 5d c3 66 2e 0f 1f 84 00 00 00 00 00 <55> 48 89 e5 41 57 41 56 41 55 41 54 53 48 89 fb 49 bc 00 00 00 00 RSP: 0018:ffff8881e0b875d0 EFLAGS: 00000293 ORIG_RAX: ffffffffffffff13 RAX: ffffffff81880249 RBX: ffffea000766b6c0 RCX: ffff8881e1f95e80 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffffea000766b6c0 RBP: ffff8881e0b87610 R08: dffffc0000000000 R09: fffff94000ecd6df R10: fffff94000ecd6df R11: 1ffffd4000ecd6de R12: ffffea000766b6d8 R13: dffffc0000000000 R14: 0000000000000000 R15: 0000000000000000 zap_pte_range mm/memory.c:1105 [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+0xe8f/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:0x7f11e8d5a969 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:00007f11e73c3038 EFLAGS: 00000246 ORIG_RAX: 0000000000000141 RAX: fffffffffffffff5 RBX: 00007f11e8f81fa0 RCX: 00007f11e8d5a969 RDX: 0000000000000080 RSI: 0000200000000280 RDI: 0000000000000005 RBP: 00007f11e8ddcab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f11e8f81fa0 R15: 00007ffe98de6f98 Modules linked in: CR2: 0000000000000000 ---[ end trace a835f6ea0e3bc0d7 ]--- RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010202 RAX: ffffffff8150a590 RBX: 0000000000000101 RCX: ffff8881e1f95e80 RDX: 0000000080000101 RSI: 0000000000000000 RDI: ffff8881eac7b1c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffb318 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881eac7b1c0 FS: 00007f11e73c36c0(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001d640e000 CR4: 00000000003406b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 ---------------- Code disassembly (best guess), 2 bytes skipped: 0: 00 00 add %al,(%rax) 2: 41 89 f7 mov %esi,%r15d 5: 49 89 fe mov %rdi,%r14 8: 43 8d 3c 3f lea (%r15,%r15,1),%edi c: 46 8d 24 fd 7b 71 f5 lea 0x75f5717b(,%r15,8),%r12d 13: 75 14: 83 ff 04 cmp $0x4,%edi 17: 0f 82 87 00 00 00 jb 0xa4 1d: 45 89 e3 mov %r12d,%r11d 20: 44 89 e1 mov %r12d,%ecx 23: 4c 89 f6 mov %r14,%rsi 26: 03 0e add (%rsi),%ecx * 28: 44 03 5e 04 add 0x4(%rsi),%r11d <-- trapping instruction 2c: 44 03 66 08 add 0x8(%rsi),%r12d 30: 45 89 e0 mov %r12d,%r8d 33: 41 c1 c0 04 rol $0x4,%r8d 37: 44 29 e1 sub %r12d,%ecx 3a: 41 31 c8 xor %ecx,%r8d 3d: 45 rex.RB