================================================================== BUG: KASAN: use-after-free in cleancache_fs_enabled_mapping include/linux/cleancache.h:56 [inline] BUG: KASAN: use-after-free in cleancache_invalidate_page include/linux/cleancache.h:110 [inline] BUG: KASAN: use-after-free in unaccount_page_cache_page+0x6d8/0x750 mm/filemap.c:163 Read of size 4 at addr ffff888137a8e470 by task syz-executor.3/28881 CPU: 1 PID: 28881 Comm: syz-executor.3 Not tainted 5.15.148-syzkaller-00718-g993bed180178 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/25/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x151/0x1b7 lib/dump_stack.c:106 print_address_description+0x87/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 cleancache_fs_enabled_mapping include/linux/cleancache.h:56 [inline] cleancache_invalidate_page include/linux/cleancache.h:110 [inline] unaccount_page_cache_page+0x6d8/0x750 mm/filemap.c:163 __delete_from_page_cache+0xc6/0x5b0 mm/filemap.c:231 __remove_mapping+0x566/0x690 mm/vmscan.c:1201 shrink_page_list+0x2723/0x5c50 mm/vmscan.c:1798 shrink_inactive_list mm/vmscan.c:2305 [inline] shrink_list mm/vmscan.c:2550 [inline] shrink_lruvec+0x17ec/0x4580 mm/vmscan.c:5753 shrink_node_memcgs mm/vmscan.c:5945 [inline] shrink_node+0x1077/0x24e0 mm/vmscan.c:5975 shrink_zones mm/vmscan.c:6178 [inline] do_try_to_free_pages+0x5ca/0x1570 mm/vmscan.c:6236 try_to_free_mem_cgroup_pages+0x36c/0x850 mm/vmscan.c:6550 try_charge_memcg+0x48f/0x1550 mm/memcontrol.c:2686 try_charge mm/memcontrol.c:2811 [inline] charge_memcg+0x6b/0x1a0 mm/memcontrol.c:6814 __mem_cgroup_charge+0x37/0x130 mm/memcontrol.c:6850 mem_cgroup_charge include/linux/memcontrol.h:715 [inline] __add_to_page_cache_locked+0x2d1/0xa20 mm/filemap.c:892 add_to_page_cache_lru+0x11b/0x2c0 mm/filemap.c:984 pagecache_get_page+0xbe1/0xeb0 mm/filemap.c:1951 grab_cache_page_write_begin+0x5d/0xa0 mm/filemap.c:3797 ext4_da_write_begin+0x5ae/0xc30 fs/ext4/inode.c:3003 generic_perform_write+0x2bc/0x5a0 mm/filemap.c:3843 ext4_buffered_write_iter+0x48a/0x610 fs/ext4/file.c:270 ext4_file_write_iter+0x443/0x1c80 __kernel_write+0x5ab/0xa60 fs/read_write.c:539 __dump_emit+0x261/0x3a0 fs/coredump.c:875 dump_emit+0x381/0x3f0 fs/coredump.c:912 dump_user_range+0x86/0x1c0 fs/coredump.c:949 elf_core_dump+0x3663/0x3e80 fs/binfmt_elf.c:2285 do_coredump+0x1834/0x3050 fs/coredump.c:826 get_signal+0x4c8/0x1630 kernel/signal.c:2882 arch_do_signal_or_restart+0xbd/0x1680 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:148 [inline] exit_to_user_mode_loop+0xa0/0xe0 kernel/entry/common.c:172 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208 irqentry_exit_to_user_mode+0x9/0x20 kernel/entry/common.c:314 irqentry_exit+0x12/0x40 kernel/entry/common.c:405 exc_page_fault+0x47a/0x830 arch/x86/mm/fault.c:1608 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0x7fb57dd0adb1 Code: c4 28 c3 e8 e1 20 00 00 90 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 b0 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:0000000000000010 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007fb57de38f80 RCX: 00007fb57dd0ada9 RDX: 0000000000000000 RSI: 0000000000000010 RDI: 0000000000000000 RBP: 00007fb57dd5747a R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007fb57de38f80 R15: 00007fff77576558 The buggy address belongs to the page: page:ffffea0004dea380 refcount:0 mapcount:-128 mapping:0000000000000000 index:0x0 pfn:0x137a8e flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea000569a488 ffffea0004345908 0000000000000000 raw: 0000000000000000 0000000000000001 00000000ffffff7f 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as freed page last allocated via order 0, migratetype Unmovable, gfp_mask 0x102dc2(GFP_HIGHUSER|__GFP_NOWARN|__GFP_ZERO), pid 28736, ts 1051438473249, free_ts 1051440120429 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2604 prep_new_page+0x1b/0x110 mm/page_alloc.c:2610 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4484 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5776 __vmalloc_area_node mm/vmalloc.c:2955 [inline] __vmalloc_node_range+0x482/0x8d0 mm/vmalloc.c:3086 alloc_thread_stack_node kernel/fork.c:254 [inline] dup_task_struct+0x416/0xc60 kernel/fork.c:944 copy_process+0x5c4/0x3290 kernel/fork.c:2094 kernel_clone+0x21e/0x9e0 kernel/fork.c:2662 __do_sys_clone3 kernel/fork.c:2946 [inline] __se_sys_clone3 kernel/fork.c:2930 [inline] __x64_sys_clone3+0x376/0x3a0 kernel/fork.c:2930 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x61/0xcb page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1471 [inline] free_pcp_prepare mm/page_alloc.c:1543 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3533 free_unref_page+0xe8/0x750 mm/page_alloc.c:3615 free_the_page mm/page_alloc.c:804 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5852 __vunmap+0x7bc/0x8f0 mm/vmalloc.c:2652 free_work+0x5b/0x80 mm/vmalloc.c:96 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Memory state around the buggy address: ffff888137a8e300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888137a8e380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff888137a8e400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff888137a8e480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff888137a8e500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ================================================================== syz-executor.3 (28881) used greatest stack depth: 17120 bytes left