================================================================== BUG: KASAN: slab-out-of-bounds in instrument_atomic_read include/linux/instrumented.h:68 [inline] BUG: KASAN: slab-out-of-bounds in atomic64_read include/linux/atomic/atomic-instrumented.h:1610 [inline] BUG: KASAN: slab-out-of-bounds in memcg_vmstats_needs_flush mm/memcontrol.c:569 [inline] BUG: KASAN: slab-out-of-bounds in memcg_rstat_updated+0x154/0x2f0 mm/memcontrol.c:594 Read of size 8 at addr ffff888063425668 by task syz.5.58/6586 CPU: 0 UID: 0 PID: 6586 Comm: syz.5.58 Not tainted 6.13.0-rc3-next-20241220-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 kasan_check_range+0x282/0x290 mm/kasan/generic.c:189 instrument_atomic_read include/linux/instrumented.h:68 [inline] atomic64_read include/linux/atomic/atomic-instrumented.h:1610 [inline] memcg_vmstats_needs_flush mm/memcontrol.c:569 [inline] memcg_rstat_updated+0x154/0x2f0 mm/memcontrol.c:594 __count_memcg_events+0x1a7/0x3d0 mm/memcontrol.c:857 memcg1_uncharge_batch+0x141/0x230 mm/memcontrol-v1.c:592 uncharge_batch+0x331/0x470 mm/memcontrol.c:4634 __mem_cgroup_uncharge_folios+0x14a/0x1c0 mm/memcontrol.c:4722 mem_cgroup_uncharge_folios include/linux/memcontrol.h:674 [inline] folios_put_refs+0x764/0x860 mm/swap.c:989 free_pages_and_swap_cache+0x5c8/0x690 mm/swap_state.c:335 __tlb_batch_free_encoded_pages mm/mmu_gather.c:136 [inline] tlb_batch_pages_flush mm/mmu_gather.c:149 [inline] tlb_flush_mmu_free mm/mmu_gather.c:373 [inline] tlb_flush_mmu+0x3a3/0x680 mm/mmu_gather.c:380 tlb_finish_mmu+0xd4/0x200 mm/mmu_gather.c:472 exit_mmap+0x52f/0xd50 mm/mmap.c:1357 __mmput+0x115/0x420 kernel/fork.c:1345 exit_mm+0x220/0x310 kernel/exit.c:570 do_exit+0x9b2/0x28e0 kernel/exit.c:925 do_group_exit+0x207/0x2c0 kernel/exit.c:1087 get_signal+0x16b2/0x1750 kernel/signal.c:3017 arch_do_signal_or_restart+0x96/0x860 arch/x86/kernel/signal.c:337 exit_to_user_mode_loop kernel/entry/common.c:111 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0xce/0x340 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fd9f9b85d29 Code: Unable to access opcode bytes at 0x7fd9f9b85cff. RSP: 002b:00007fd9fa944038 EFLAGS: 00000246 ORIG_RAX: 000000000000012b RAX: 0000000000010106 RBX: 00007fd9f9d75fa0 RCX: 00007fd9f9b85d29 RDX: 0000000000010106 RSI: 00000000200000c0 RDI: 0000000000000006 RBP: 00007fd9f9c01b08 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000002 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fd9f9d75fa0 R15: 00007ffebe5d83c8 Allocated by task 6188: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:377 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:394 kasan_kmalloc include/linux/kasan.h:260 [inline] __kmalloc_cache_noprof+0x243/0x390 mm/slub.c:4325 kmalloc_noprof include/linux/slab.h:901 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] mem_cgroup_alloc mm/memcontrol.c:3502 [inline] mem_cgroup_css_alloc+0x5ec/0x1690 mm/memcontrol.c:3565 css_create kernel/cgroup/cgroup.c:5631 [inline] cgroup_apply_control_enable+0x39c/0xaf0 kernel/cgroup/cgroup.c:3239 cgroup_mkdir+0xa83/0xd60 kernel/cgroup/cgroup.c:5847 kernfs_iop_mkdir+0x253/0x3f0 fs/kernfs/dir.c:1246 vfs_mkdir+0x2f9/0x4f0 fs/namei.c:4311 do_mkdirat+0x264/0x3a0 fs/namei.c:4334 __do_sys_mkdirat fs/namei.c:4349 [inline] __se_sys_mkdirat fs/namei.c:4347 [inline] __x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4347 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f The buggy address belongs to the object at ffff888063425000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 0 bytes to the right of allocated 1640-byte region [ffff888063425000, ffff888063425668) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x63420 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888032bcdd81 flags: 0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000040 ffff88801ac4f3c0 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000080008 00000000f5000000 ffff888032bcdd81 head: 00fff00000000040 ffff88801ac4f3c0 dead000000000100 dead000000000122 head: 0000000000000000 0000000000080008 00000000f5000000 ffff888032bcdd81 head: 00fff00000000003 ffffea00018d0801 ffffffffffffffff 0000000000000000 head: 0000000000000008 0000000000000000 00000000ffffffff 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5832, tgid 5832 (syz-executor), ts 63356512013, free_ts 15835222156 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4754 alloc_pages_mpol+0x30e/0x550 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2587 new_slab mm/slub.c:2640 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3826 __slab_alloc+0x58/0xa0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] __do_kmalloc_node mm/slub.c:4293 [inline] __kmalloc_noprof+0x2e6/0x4c0 mm/slub.c:4306 kmalloc_noprof include/linux/slab.h:905 [inline] kzalloc_noprof include/linux/slab.h:1037 [inline] __register_sysctl_table+0xd4/0x1430 fs/proc/proc_sysctl.c:1375 __devinet_sysctl_register+0x1dc/0x2a0 net/ipv4/devinet.c:2630 devinet_sysctl_register+0x17e/0x1f0 net/ipv4/devinet.c:2670 inetdev_init+0x2b4/0x4e0 net/ipv4/devinet.c:299 inetdev_event+0x340/0x1550 net/ipv4/devinet.c:1598 notifier_call_chain+0x1a5/0x3f0 kernel/notifier.c:85 call_netdevice_notifiers_extack net/core/dev.c:2034 [inline] call_netdevice_notifiers net/core/dev.c:2048 [inline] register_netdevice+0x167f/0x1b00 net/core/dev.c:10632 __ip_tunnel_create+0x2b4/0x380 net/ipv4/ip_tunnel.c:267 page last free pid 1 tgid 1 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] free_frozen_pages+0xe0d/0x10e0 mm/page_alloc.c:2660 free_contig_range+0x14c/0x430 mm/page_alloc.c:6697 destroy_args+0x92/0x910 mm/debug_vm_pgtable.c:1017 debug_vm_pgtable+0x4be/0x550 mm/debug_vm_pgtable.c:1397 do_one_initcall+0x248/0x870 init/main.c:1267 do_initcall_level+0x157/0x210 init/main.c:1329 do_initcalls+0x3f/0x80 init/main.c:1345 kernel_init_freeable+0x435/0x5d0 init/main.c:1578 kernel_init+0x1d/0x2b0 init/main.c:1467 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Memory state around the buggy address: ffff888063425500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888063425580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888063425600: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ^ ffff888063425680: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888063425700: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================