================================================================== 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 ffff88811a26d470 by task syz-executor.4/20573 CPU: 1 PID: 20573 Comm: syz-executor.4 Not tainted 5.15.106-syzkaller-00249-g19c0ed55a470 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/28/2023 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:1197 shrink_page_list+0x25f1/0x5820 mm/vmscan.c:1789 shrink_inactive_list mm/vmscan.c:2261 [inline] shrink_list mm/vmscan.c:2506 [inline] shrink_lruvec+0x17e9/0x4340 mm/vmscan.c:5694 shrink_node_memcgs mm/vmscan.c:5886 [inline] shrink_node+0x1077/0x24e0 mm/vmscan.c:5916 shrink_zones mm/vmscan.c:6119 [inline] do_try_to_free_pages+0x5b6/0x1570 mm/vmscan.c:6177 try_to_free_mem_cgroup_pages+0x36c/0x850 mm/vmscan.c:6491 memory_high_write+0x243/0x3b0 mm/memcontrol.c:6382 cgroup_file_write+0x290/0x590 kernel/cgroup/cgroup.c:3943 kernfs_fop_write_iter+0x2c4/0x410 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2159 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xd8a/0x1160 fs/read_write.c:594 ksys_write+0x199/0x2c0 fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:656 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 RIP: 0033:0x7f4bd2ed6169 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 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 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f4bd1c28168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f4bd2ff6050 RCX: 00007f4bd2ed6169 RDX: 0000000000000012 RSI: 0000000020000300 RDI: 0000000000000008 RBP: 00007f4bd2f31ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe73fbae8f R14: 00007f4bd1c28300 R15: 0000000000022000 The buggy address belongs to the page: page:ffffea0004689b40 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11a26d flags: 0x4000000000000000(zone=1) raw: 4000000000000000 ffffea0004689b88 ffffea00052faf48 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), pid 12140, ts 1599037100347, free_ts 1599236597896 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2502 prep_new_page mm/page_alloc.c:2508 [inline] get_page_from_freelist+0x2c14/0x2cf0 mm/page_alloc.c:4291 __alloc_pages+0x386/0x7b0 mm/page_alloc.c:5569 __vmalloc_area_node mm/vmalloc.c:2951 [inline] __vmalloc_node_range+0x457/0x7d0 mm/vmalloc.c:3080 __vmalloc_node mm/vmalloc.c:3145 [inline] vzalloc+0x78/0x90 mm/vmalloc.c:3215 xt_counters_alloc+0x44/0x50 net/netfilter/x_tables.c:1379 __do_replace+0xc4/0xac0 net/ipv4/netfilter/ip_tables.c:1047 do_replace net/ipv4/netfilter/ip_tables.c:1138 [inline] do_ipt_set_ctl+0x2cf7/0x3e80 net/ipv4/netfilter/ip_tables.c:1628 nf_setsockopt+0x274/0x2a0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x2ae7/0x4730 net/ipv4/ip_sockglue.c:1435 tcp_setsockopt+0x22d/0x3800 net/ipv4/tcp.c:3691 sock_common_setsockopt+0xa2/0xc0 net/core/sock.c:3425 __sys_setsockopt+0x4dc/0x840 net/socket.c:2179 __do_sys_setsockopt net/socket.c:2190 [inline] __se_sys_setsockopt net/socket.c:2187 [inline] __x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2187 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:1370 [inline] free_pcp_prepare mm/page_alloc.c:1442 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3441 free_unref_page+0xac/0x2c0 mm/page_alloc.c:3521 free_the_page mm/page_alloc.c:711 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5645 __vunmap+0x7bc/0x8f0 mm/vmalloc.c:2652 __vfree mm/vmalloc.c:2700 [inline] vfree+0x7f/0xb0 mm/vmalloc.c:2731 __do_replace+0x298/0xac0 net/ipv4/netfilter/ip_tables.c:1098 do_replace net/ipv4/netfilter/ip_tables.c:1138 [inline] do_ipt_set_ctl+0x2cf7/0x3e80 net/ipv4/netfilter/ip_tables.c:1628 nf_setsockopt+0x274/0x2a0 net/netfilter/nf_sockopt.c:101 ip_setsockopt+0x2ae7/0x4730 net/ipv4/ip_sockglue.c:1435 tcp_setsockopt+0x22d/0x3800 net/ipv4/tcp.c:3691 sock_common_setsockopt+0xa2/0xc0 net/core/sock.c:3425 __sys_setsockopt+0x4dc/0x840 net/socket.c:2179 __do_sys_setsockopt net/socket.c:2190 [inline] __se_sys_setsockopt net/socket.c:2187 [inline] __x64_sys_setsockopt+0xbf/0xd0 net/socket.c:2187 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 Memory state around the buggy address: ffff88811a26d300: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811a26d380: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffff88811a26d400: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffff88811a26d480: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffff88811a26d500: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ==================================================================