================================================================== BUG: KASAN: use-after-free in cleancache_fs_enabled_mapping include/linux/cleancache.h:54 [inline] BUG: KASAN: use-after-free in cleancache_invalidate_page include/linux/cleancache.h:108 [inline] BUG: KASAN: use-after-free in unaccount_page_cache_page+0x714/0x780 mm/filemap.c:169 Read of size 4 at addr ffff8881eac52488 by task syz.7.2361/9792 CPU: 0 PID: 9792 Comm: syz.7.2361 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_load4_noabort+0x14/0x20 mm/kasan/generic_report.c:131 cleancache_fs_enabled_mapping include/linux/cleancache.h:54 [inline] cleancache_invalidate_page include/linux/cleancache.h:108 [inline] unaccount_page_cache_page+0x714/0x780 mm/filemap.c:169 __delete_from_page_cache+0xc3/0x4b0 mm/filemap.c:237 __remove_mapping+0x4ba/0x590 mm/vmscan.c:985 shrink_page_list+0x201b/0x3be0 mm/vmscan.c:1489 shrink_inactive_list+0x479/0xd30 mm/vmscan.c:2008 shrink_list mm/vmscan.c:2300 [inline] shrink_node_memcg+0xaf8/0x1af0 mm/vmscan.c:2630 shrink_node+0x433/0x1430 mm/vmscan.c:2843 shrink_zones mm/vmscan.c:3063 [inline] do_try_to_free_pages+0x5aa/0x11c0 mm/vmscan.c:3121 try_to_free_mem_cgroup_pages+0x22e/0x6a0 mm/vmscan.c:3422 try_charge+0x482/0x1310 mm/memcontrol.c:2627 mem_cgroup_try_charge+0x2c4/0x400 mm/memcontrol.c:6600 mem_cgroup_try_charge_delay+0x13/0x50 mm/memcontrol.c:6615 shmem_getpage_gfp+0x1067/0x2370 mm/shmem.c:1886 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:0x7f58d89b5971 Code: 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 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:0000200000000080 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f58d8bdcfa0 RCX: 00007f58d89b5969 RDX: 00002000000000c0 RSI: 0000200000000080 RDI: 0000000000001000 RBP: 00007f58d8a37ab1 R08: 0000200000000140 R09: 0000200000000140 R10: 0000200000000100 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f58d8bdcfa0 R15: 00007ffe1416b998 Allocated by task 164: 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+0x19/0x20 fs/namei.c:212 do_sys_open+0x26c/0x5d0 fs/open.c:1117 __do_sys_openat fs/open.c:1150 [inline] __se_sys_openat fs/open.c:1144 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1144 do_syscall_64+0xcf/0x170 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 164: 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+0xfe/0x150 fs/namei.c:262 do_sys_open+0x520/0x5d0 fs/open.c:1132 __do_sys_openat fs/open.c:1150 [inline] __se_sys_openat fs/open.c:1144 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1144 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 ffff8881eac52200 which belongs to the cache names_cache of size 4096 The buggy address is located 648 bytes inside of 4096-byte region [ffff8881eac52200, ffff8881eac53200) The buggy address belongs to the page: page:ffffea0007ab1400 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+0x19/0x20 fs/namei.c:212 do_sys_open+0x26c/0x5d0 fs/open.c:1117 __do_sys_openat fs/open.c:1150 [inline] __se_sys_openat fs/open.c:1144 [inline] __x64_sys_openat+0xa2/0xb0 fs/open.c:1144 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 __free_slab+0x218/0x2d0 mm/slub.c:1774 free_slab mm/slub.c:1789 [inline] discard_slab mm/slub.c:1795 [inline] unfreeze_partials+0x165/0x1a0 mm/slub.c:2288 put_cpu_partial+0xc1/0x180 mm/slub.c:2324 __slab_free+0x2be/0x380 mm/slub.c:2971 do_slab_free mm/slub.c:3068 [inline] ___cache_free+0xbb/0xd0 mm/slub.c:3087 qlink_free+0x23/0x30 mm/kasan/quarantine.c:148 qlist_free_all+0x5f/0xb0 mm/kasan/quarantine.c:167 quarantine_reduce+0x1a8/0x200 mm/kasan/quarantine.c:260 __kasan_kmalloc+0x42/0x200 mm/kasan/common.c:507 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 user_path_at_empty+0x2f/0x50 fs/namei.c:2703 user_path_at include/linux/namei.h:49 [inline] vfs_statx+0x116/0x200 fs/stat.c:187 Memory state around the buggy address: ffff8881eac52380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881eac52400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881eac52480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881eac52500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881eac52580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================