================================================================== 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 ffff8881e5d831c8 by task syz.4.46/552 CPU: 0 PID: 552 Comm: syz.4.46 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:stack_trace_consume_entry+0xe2/0x250 kernel/stacktrace.c:93 Code: 00 fc ff df 0f b6 04 03 84 c0 0f 85 24 01 00 00 48 8b 45 d0 44 89 30 b0 01 e9 a8 00 00 00 e8 15 c2 0f 00 31 c0 e9 9c 00 00 00 09 c2 0f 00 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df RSP: 0018:ffff8881e7546508 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: ffffffff814fbc95 RBX: 1ffff1103cea8cc5 RCX: 0000000000000000 RDX: ffff8881e73f0fc0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff8881e7546558 R08: dffffc0000000000 R09: ffff8881e7546568 R10: ffffed103cea8cb9 R11: 1ffff1103cea8cad R12: ffff8881e7546620 R13: 1ffff1103cea8cc6 R14: 0000000000000000 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 __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] shmem_alloc_page mm/shmem.c:1503 [inline] shmem_alloc_and_acct_page+0x40b/0x820 mm/shmem.c:1528 shmem_getpage_gfp+0xe89/0x2370 mm/shmem.c:1852 shmem_getpage mm/shmem.c:154 [inline] shmem_write_begin+0xce/0x1b0 mm/shmem.c:2447 generic_perform_write+0x2b8/0x500 mm/filemap.c:3450 __generic_file_write_iter+0x24b/0x480 mm/filemap.c:3579 generic_file_write_iter+0x48d/0x620 mm/filemap.c:3611 call_write_iter include/linux/fs.h:1991 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x480/0x5d0 fs/read_write.c:496 __kernel_write+0xea/0x320 fs/read_write.c:515 dump_emit+0x1c0/0x2c0 fs/coredump.c:838 elf_core_dump+0x3465/0x3bd0 fs/binfmt_elf.c:2352 do_coredump+0x1d8c/0x2ab0 fs/coredump.c:801 get_signal+0xdb7/0x13d0 kernel/signal.c:2732 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 ret_from_intr+0x1c/0x1c RIP: 0033:0x0 Code: Bad RIP value. RSP: 002b:0000200000000148 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007fb5b9263fa0 RCX: 00007fb5b903c969 RDX: 0000000000000000 RSI: 0000200000000140 RDI: 0000000000020000 RBP: 00007fb5b90beab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000200000000200 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fb5b9263fa0 R15: 00007ffc085f4588 Allocated by task 588: 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_node include/linux/slab.h:422 [inline] kmalloc_node include/linux/slab.h:599 [inline] kvmalloc_node+0x88/0xf0 mm/util.c:596 kvmalloc include/linux/mm.h:761 [inline] kvmalloc_array include/linux/mm.h:779 [inline] __ptr_ring_init_queue_alloc include/linux/ptr_ring.h:470 [inline] ptr_ring_init include/linux/ptr_ring.h:488 [inline] skb_array_init include/linux/skb_array.h:182 [inline] pfifo_fast_init+0x260/0x7a0 net/sched/sch_generic.c:784 qdisc_create_dflt+0x135/0x270 net/sched/sch_generic.c:944 mq_init+0x2df/0x660 net/sched/sch_mq.c:90 qdisc_create_dflt+0x135/0x270 net/sched/sch_generic.c:944 attach_default_qdiscs net/sched/sch_generic.c:1113 [inline] dev_activate+0x132/0xc80 net/sched/sch_generic.c:1154 __dev_open+0x2d3/0x3f0 net/core/dev.c:1335 __dev_change_flags+0x20a/0x6a0 net/core/dev.c:7958 dev_change_flags+0x88/0x1a0 net/core/dev.c:8029 dev_ifsioc+0x110/0xa40 net/core/dev_ioctl.c:226 dev_ioctl+0x550/0xb80 net/core/dev_ioctl.c:483 sock_do_ioctl+0x235/0x330 net/socket.c:1081 sock_ioctl+0x505/0x710 net/socket.c:1198 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 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 0: (stack is not available) The buggy address belongs to the object at ffff8881e5d80000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4552 bytes to the right of 8192-byte region [ffff8881e5d80000, ffff8881e5d82000) The buggy address belongs to the page: page:ffffea0007976000 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_node include/linux/slab.h:422 [inline] kmalloc_node include/linux/slab.h:599 [inline] kvmalloc_node+0x88/0xf0 mm/util.c:596 kvmalloc include/linux/mm.h:761 [inline] kvmalloc_array include/linux/mm.h:779 [inline] __ptr_ring_init_queue_alloc include/linux/ptr_ring.h:470 [inline] ptr_ring_init include/linux/ptr_ring.h:488 [inline] skb_array_init include/linux/skb_array.h:182 [inline] pfifo_fast_init+0x112/0x7a0 net/sched/sch_generic.c:784 qdisc_create_dflt+0x135/0x270 net/sched/sch_generic.c:944 mq_init+0x2df/0x660 net/sched/sch_mq.c:90 qdisc_create_dflt+0x135/0x270 net/sched/sch_generic.c:944 attach_default_qdiscs net/sched/sch_generic.c:1113 [inline] dev_activate+0x132/0xc80 net/sched/sch_generic.c:1154 __dev_open+0x2d3/0x3f0 net/core/dev.c:1335 __dev_change_flags+0x20a/0x6a0 net/core/dev.c:7958 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 netdev_run_todo+0xae4/0xc70 net/core/dev.c:9488 rtnl_unlock+0xe/0x10 net/core/rtnetlink.c:112 tun_detach drivers/net/tun.c:766 [inline] tun_chr_close+0xc4/0x140 drivers/net/tun.c:3563 __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 Memory state around the buggy address: ffff8881e5d83080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e5d83100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881e5d83180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881e5d83200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881e5d83280: 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 1e7739067 P4D 1e7739067 PUD 0 Oops: 0010 [#1] PREEMPT SMP KASAN CPU: 0 PID: 552 Comm: syz.4.46 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: ffff8881e73f0fc0 RDX: 0000000000000100 RSI: 0000000000000000 RDI: ffff8881e5d831c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffff9ae0 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e5d831c0 FS: 00007fb5b76a56c0(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001e6d58000 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:stack_trace_consume_entry+0xe2/0x250 kernel/stacktrace.c:93 Code: 00 fc ff df 0f b6 04 03 84 c0 0f 85 24 01 00 00 48 8b 45 d0 44 89 30 b0 01 e9 a8 00 00 00 e8 15 c2 0f 00 31 c0 e9 9c 00 00 00 09 c2 0f 00 4c 89 e0 48 c1 e8 03 48 b9 00 00 00 00 00 fc ff df RSP: 0018:ffff8881e7546508 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff13 RAX: ffffffff814fbc95 RBX: 1ffff1103cea8cc5 RCX: 0000000000000000 RDX: ffff8881e73f0fc0 RSI: 0000000000000000 RDI: 0000000000000000 RBP: ffff8881e7546558 R08: dffffc0000000000 R09: ffff8881e7546568 R10: ffffed103cea8cb9 R11: 1ffff1103cea8cad R12: ffff8881e7546620 R13: 1ffff1103cea8cc6 R14: 0000000000000000 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 __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] shmem_alloc_page mm/shmem.c:1503 [inline] shmem_alloc_and_acct_page+0x40b/0x820 mm/shmem.c:1528 shmem_getpage_gfp+0xe89/0x2370 mm/shmem.c:1852 shmem_getpage mm/shmem.c:154 [inline] shmem_write_begin+0xce/0x1b0 mm/shmem.c:2447 generic_perform_write+0x2b8/0x500 mm/filemap.c:3450 __generic_file_write_iter+0x24b/0x480 mm/filemap.c:3579 generic_file_write_iter+0x48d/0x620 mm/filemap.c:3611 call_write_iter include/linux/fs.h:1991 [inline] new_sync_write fs/read_write.c:483 [inline] __vfs_write+0x480/0x5d0 fs/read_write.c:496 __kernel_write+0xea/0x320 fs/read_write.c:515 dump_emit+0x1c0/0x2c0 fs/coredump.c:838 elf_core_dump+0x3465/0x3bd0 fs/binfmt_elf.c:2352 do_coredump+0x1d8c/0x2ab0 fs/coredump.c:801 get_signal+0xdb7/0x13d0 kernel/signal.c:2732 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 ret_from_intr+0x1c/0x1c RIP: 0033:0x0 Code: Bad RIP value. RSP: 002b:0000200000000148 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007fb5b9263fa0 RCX: 00007fb5b903c969 RDX: 0000000000000000 RSI: 0000200000000140 RDI: 0000000000020000 RBP: 00007fb5b90beab1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000200000000200 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fb5b9263fa0 R15: 00007ffc085f4588 Modules linked in: CR2: 0000000000000000 ---[ end trace d2476ae619abedb5 ]--- RIP: 0010:0x0 Code: Bad RIP value. RSP: 0018:ffff8881f6e09cf0 EFLAGS: 00010206 RAX: ffffffff8150a590 RBX: 0000000000000100 RCX: ffff8881e73f0fc0 RDX: 0000000000000100 RSI: 0000000000000000 RDI: ffff8881e5d831c0 RBP: ffff8881f6e09d30 R08: 0000000000000004 R09: 0000000000000003 R10: ffffed103edc1398 R11: 1ffff1103edc1398 R12: 00000000ffff9ae0 R13: dffffc0000000000 R14: 0000000000000000 R15: ffff8881e5d831c0 FS: 00007fb5b76a56c0(0000) GS:ffff8881f6e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: ffffffffffffffd6 CR3: 00000001e6d58000 CR4: 00000000003406b0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 ---------------- Code disassembly (best guess), 3 bytes skipped: 0: df 0f fisttps (%rdi) 2: b6 04 mov $0x4,%dh 4: 03 84 c0 0f 85 24 01 add 0x124850f(%rax,%rax,8),%eax b: 00 00 add %al,(%rax) d: 48 8b 45 d0 mov -0x30(%rbp),%rax 11: 44 89 30 mov %r14d,(%rax) 14: b0 01 mov $0x1,%al 16: e9 a8 00 00 00 jmp 0xc3 1b: e8 15 c2 0f 00 call 0xfc235 20: 31 c0 xor %eax,%eax 22: e9 9c 00 00 00 jmp 0xc3 * 27: e8 09 c2 0f 00 call 0xfc235 <-- trapping instruction 2c: 4c 89 e0 mov %r12,%rax 2f: 48 c1 e8 03 shr $0x3,%rax 33: 48 b9 00 00 00 00 00 movabs $0xdffffc0000000000,%rcx 3a: fc ff df