================================================================== 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+0x6e6/0x750 mm/filemap.c:169 Read of size 4 at addr ffff8881eb30f488 by task syz-executor.0/21028 CPU: 1 PID: 21028 Comm: syz-executor.0 Tainted: G W 5.4.242-syzkaller-00065-g10e0626a3202 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 cleancache_fs_enabled_mapping include/linux/cleancache.h:54 [inline] cleancache_invalidate_page include/linux/cleancache.h:108 [inline] unaccount_page_cache_page+0x6e6/0x750 mm/filemap.c:169 __delete_from_page_cache+0xd0/0x600 mm/filemap.c:237 __remove_mapping+0x4a2/0x590 mm/vmscan.c:978 shrink_page_list+0x22f9/0x42c0 mm/vmscan.c:1482 shrink_inactive_list+0x533/0xfe0 mm/vmscan.c:2001 shrink_list mm/vmscan.c:2293 [inline] shrink_node_memcg+0xc42/0x2430 mm/vmscan.c:2623 shrink_node+0x389/0x14a0 mm/vmscan.c:2836 shrink_zones mm/vmscan.c:3053 [inline] do_try_to_free_pages+0x63f/0x12b0 mm/vmscan.c:3111 try_to_free_mem_cgroup_pages+0x3f6/0x9b0 mm/vmscan.c:3412 memory_high_write+0x176/0x260 mm/memcontrol.c:6177 cgroup_file_write+0x275/0x5f0 kernel/cgroup/cgroup.c:3898 kernfs_fop_write+0x2e2/0x3e0 fs/kernfs/file.c:315 __vfs_write+0x103/0x750 fs/read_write.c:494 vfs_write+0x206/0x4e0 fs/read_write.c:558 ksys_write+0x199/0x2c0 fs/read_write.c:611 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 The buggy address belongs to the page: page:ffffea0007acc3c0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 flags: 0x8000000000000000() raw: 8000000000000000 ffffea00079d2808 ffffea0007acc388 0000000000000000 raw: 0000000000000000 0000000000000000 00000000ffffffff 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) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2d13/0x2d90 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4891 __vmalloc_area_node mm/vmalloc.c:2431 [inline] __vmalloc_node_range+0x384/0x710 mm/vmalloc.c:2499 __vmalloc_node mm/vmalloc.c:2554 [inline] __vmalloc_node_flags mm/vmalloc.c:2568 [inline] vzalloc+0x70/0x80 mm/vmalloc.c:2613 __do_replace+0xc9/0xac0 net/ipv4/netfilter/ip_tables.c:1049 do_replace net/ipv4/netfilter/ip_tables.c:1140 [inline] do_ipt_set_ctl+0x404/0x600 net/ipv4/netfilter/ip_tables.c:1674 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x28f/0x2b0 net/netfilter/nf_sockopt.c:115 __sys_setsockopt+0x4b4/0x840 net/socket.c:2074 __do_sys_setsockopt net/socket.c:2090 [inline] __se_sys_setsockopt net/socket.c:2087 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2087 do_syscall_64+0xca/0x1c0 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_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x297/0x380 mm/page_alloc.c:3085 free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4951 [inline] __free_pages+0xaf/0x140 mm/page_alloc.c:4959 __vunmap+0x75b/0x890 mm/vmalloc.c:2260 __do_replace+0x855/0xac0 net/ipv4/netfilter/ip_tables.c:1088 do_replace net/ipv4/netfilter/ip_tables.c:1140 [inline] do_ipt_set_ctl+0x404/0x600 net/ipv4/netfilter/ip_tables.c:1674 nf_sockopt net/netfilter/nf_sockopt.c:106 [inline] nf_setsockopt+0x28f/0x2b0 net/netfilter/nf_sockopt.c:115 __sys_setsockopt+0x4b4/0x840 net/socket.c:2074 __do_sys_setsockopt net/socket.c:2090 [inline] __se_sys_setsockopt net/socket.c:2087 [inline] __x64_sys_setsockopt+0xb1/0xc0 net/socket.c:2087 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881eb30f380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881eb30f400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff8881eb30f480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff8881eb30f500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff8881eb30f580: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================