================================================================== 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 ffff8881c296b1c8 by task syz.4.911/3453 CPU: 0 PID: 3453 Comm: syz.4.911 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:__rb_change_child include/linux/rbtree_augmented.h:176 [inline] RIP: 0010:__rb_erase_augmented include/linux/rbtree_augmented.h:216 [inline] RIP: 0010:rb_erase_augmented include/linux/rbtree_augmented.h:305 [inline] RIP: 0010:rb_erase_augmented_cached include/linux/rbtree_augmented.h:316 [inline] RIP: 0010:vma_interval_tree_remove+0x19b/0xa30 mm/interval_tree.c:23 Code: c1 ef 03 48 b8 00 00 00 00 00 fc ff df 41 80 3c 07 00 74 08 4c 89 e7 e8 23 2c 0a 00 48 8b 45 c0 49 39 04 24 0f 84 f8 03 00 00 e0 31 dc ff 4d 8d 7d 08 4c 89 f8 48 c1 e8 03 48 b9 00 00 00 00 RSP: 0018:ffff8881e65df768 EFLAGS: 00000213 ORIG_RAX: ffffffffffffff13 RAX: ffff8881e326c058 RBX: ffff8881d6ee4d10 RCX: 0000000000000000 RDX: ffff8881ecf66e40 RSI: ffff8881d6ee4d10 RDI: 0000000000000000 RBP: ffff8881e65df7c8 R08: dffffc0000000000 R09: ffffed103eb181c0 R10: ffffed103eb181c0 R11: 1ffff1103eb181bf R12: ffff8881d6ee4d20 R13: ffff8881d6ee4d10 R14: 0000000000000000 R15: 1ffff1103addc9a4 __remove_shared_vm_struct mm/mmap.c:149 [inline] unlink_file_vma+0x171/0x190 mm/mmap.c:164 free_pgtables+0x139/0x280 mm/memory.c:428 exit_mmap+0x2ca/0x520 mm/mmap.c:3192 __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:0x7f7fef01e969 Code: Bad RIP value. RSP: 002b:00007f7fed6870e8 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca RAX: 0000000000000000 RBX: 00007f7fef245fa8 RCX: 00007f7fef01e969 RDX: 00000000000f4240 RSI: 0000000000000081 RDI: 00007f7fef245fac RBP: 00007f7fef245fa0 R08: 00007ffc8b38e0b0 R09: 0000000000000000 R10: 0000000000008e80 R11: 0000000000000246 R12: 00007f7fef245fac R13: 0000000000000000 R14: 00007ffc8b29afe0 R15: 00007ffc8b29b0c8 Allocated by task 339: 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] 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 Freed by task 339: 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] do_rmdir+0x392/0x480 fs/namei.c:4096 __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 The buggy address belongs to the object at ffff8881c296a200 which belongs to the cache names_cache of size 4096 The buggy address is located 4040 bytes inside of 4096-byte region [ffff8881c296a200, ffff8881c296b200) The buggy address belongs to the page: page:ffffea00070a5a00 refcount:1 mapcount:0 mapping:ffff8881f5d01180 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881f5d01180 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 netdev_freemem+0x3f/0x60 net/core/dev.c:9583 netdev_release+0x7f/0xb0 net/core/net-sysfs.c:1743 device_release+0x70/0x1a0 drivers/base/core.c:1776 kobject_cleanup lib/kobject.c:716 [inline] kobject_release lib/kobject.c:747 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x1fe/0x2c0 lib/kobject.c:764 put_device+0x1f/0x30 drivers/base/core.c:3010 free_netdev+0x27e/0x320 net/core/dev.c:9746 tun_set_iff+0x87c/0xe00 drivers/net/tun.c:2924 __tun_chr_ioctl+0x771/0x18a0 drivers/net/tun.c:3187 tun_chr_ioctl+0x2a/0x40 drivers/net/tun.c:3470 do_vfs_ioctl+0x753/0x13f0 fs/ioctl.c:47 ksys_ioctl fs/ioctl.c:742 [inline] __do_sys_ioctl fs/ioctl.c:749 [inline] __se_sys_ioctl fs/ioctl.c:747 [inline] __x64_sys_ioctl+0xe1/0x120 fs/ioctl.c:747 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 Memory state around the buggy address: ffff8881c296b080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881c296b100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881c296b180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881c296b200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881c296b280: 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: 336 Comm: syz-executor 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: ffff8881f0f38000 RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881c296b1c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffb3e0 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881c296b1c0 FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 0000000005c0e000 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:stack_trace_consume_entry+0x5c/0x250 kernel/stacktrace.c:86 Code: ed 03 43 0f b6 44 35 00 84 c0 0f 85 4b 01 00 00 45 8b 7c 24 10 49 8d 5c 24 08 48 89 d8 48 c1 e8 03 48 89 45 b8 42 0f b6 04 30 <84> c0 0f 85 49 01 00 00 48 89 5d c0 8b 1b 44 89 ff 89 de e8 cc c3 RSP: 0018:ffff8881f06c7448 EFLAGS: 00000a02 ORIG_RAX: ffffffffffffff13 RAX: 0000000000000000 RBX: ffff8881f06c7568 RCX: ffff8881f0f38000 RDX: 0000000000000000 RSI: ffffffff8193fc45 RDI: ffff8881f06c7560 RBP: ffff8881f06c7498 R08: dffffc0000000000 R09: ffff8881f06c74a8 R10: ffffed103e0d8ea1 R11: 1ffff1103e0d8e95 R12: ffff8881f06c7560 R13: 1ffff1103e0d8eae R14: dffffc0000000000 R15: 0000000000000006 arch_stack_walk+0x100/0x140 arch/x86/kernel/stacktrace.c:27 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 mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4954 [inline] __free_pages+0xaa/0x110 mm/page_alloc.c:4962 __vunmap+0x76a/0x8a0 mm/vmalloc.c:2260 __vfree mm/vmalloc.c:2308 [inline] vfree+0x61/0x90 mm/vmalloc.c:2338 kcov_put kernel/kcov.c:396 [inline] kcov_close+0x2b/0x50 kernel/kcov.c:495 __fput+0x2a3/0x730 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 task_work_run+0x146/0x170 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xa43/0x2660 kernel/exit.c:861 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:0x7f7fef014b93 Code: Bad RIP value. RSP: 002b:00007ffc8b29b618 EFLAGS: 00000202 ORIG_RAX: 000000000000003d RAX: fffffffffffffe00 RBX: 0000000000000155 RCX: 00007f7fef014b93 RDX: 0000000040000000 RSI: 00007ffc8b29b62c RDI: 00000000ffffffff RBP: 00007ffc8b29b62c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000008 R13: 0000000000000003 R14: 0000000000000009 R15: 0000000000000000 Modules linked in: CR2: 0000000000000000 ---[ end trace 66581d3cb9be97c5 ]--- RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010206 RAX: ffffffff8150a590 RBX: 0000000000000100 RCX: ffff8881f0f38000 RDX: 0000000080000100 RSI: 0000000000000000 RDI: ffff8881c296b1c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffffb3e0 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881c296b1c0 FS: 0000000000000000(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 0000000005c0e000 CR4: 00000000003406b0 DR0: 0000200000000300 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 ---------------- Code disassembly (best guess): 0: c1 ef 03 shr $0x3,%edi 3: 48 b8 00 00 00 00 00 movabs $0xdffffc0000000000,%rax a: fc ff df d: 41 80 3c 07 00 cmpb $0x0,(%r15,%rax,1) 12: 74 08 je 0x1c 14: 4c 89 e7 mov %r12,%rdi 17: e8 23 2c 0a 00 call 0xa2c3f 1c: 48 8b 45 c0 mov -0x40(%rbp),%rax 20: 49 39 04 24 cmp %rax,(%r12) 24: 0f 84 f8 03 00 00 je 0x422 * 2a: e8 e0 31 dc ff call 0xffdc320f <-- trapping instruction 2f: 4d 8d 7d 08 lea 0x8(%r13),%r15 33: 4c 89 f8 mov %r15,%rax 36: 48 c1 e8 03 shr $0x3,%rax 3a: 48 rex.W 3b: b9 00 00 00 00 mov $0x0,%ecx