================================================================== 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+0x99f/0xa80 mm/filemap.c:175 Read of size 4 at addr ffff88811518c470 by task syz-executor.5/9048 CPU: 0 PID: 9048 Comm: syz-executor.5 Tainted: G W 5.10.178-syzkaller-00127-g43c801dc3325 #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_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x81/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0x179/0x1c0 mm/kasan/report.c:452 __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+0x99f/0xa80 mm/filemap.c:175 __delete_from_page_cache+0xd0/0x5d0 mm/filemap.c:243 __remove_mapping+0x567/0x690 mm/vmscan.c:978 shrink_page_list+0x1f38/0x4c60 mm/vmscan.c:1491 shrink_inactive_list+0x591/0x1150 mm/vmscan.c:2048 shrink_list mm/vmscan.c:2267 [inline] shrink_lruvec+0xced/0x3820 mm/vmscan.c:5435 shrink_node_memcgs mm/vmscan.c:5622 [inline] shrink_node+0xdf3/0x1fb0 mm/vmscan.c:5652 shrink_zones mm/vmscan.c:5855 [inline] do_try_to_free_pages+0x67e/0x15e0 mm/vmscan.c:5913 try_to_free_mem_cgroup_pages+0x369/0x830 mm/vmscan.c:6231 memory_high_write+0x243/0x3b0 mm/memcontrol.c:6388 cgroup_file_write+0x290/0x590 kernel/cgroup/cgroup.c:3835 kernfs_fop_write_iter+0x2c4/0x410 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:1976 [inline] new_sync_write fs/read_write.c:518 [inline] vfs_write+0xb55/0xe70 fs/read_write.c:605 ksys_write+0x199/0x2c0 fs/read_write.c:658 __do_sys_write fs/read_write.c:670 [inline] __se_sys_write fs/read_write.c:667 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:667 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 RIP: 0033:0x7f9b8e38e169 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:00007f9b8d101168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f9b8e4adf80 RCX: 00007f9b8e38e169 RDX: 0000000000000012 RSI: 0000000020000300 RDI: 0000000000000004 RBP: 00007f9b8e3e9ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff9b3dc8df R14: 00007f9b8d101300 R15: 0000000000022000 Allocated by task 8973: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:430 [inline] ____kasan_kmalloc+0xdb/0x110 mm/kasan/common.c:509 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x18a/0x2e0 mm/slub.c:2974 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] push_stack+0x8e/0x4f0 kernel/bpf/verifier.c:979 check_cond_jmp_op kernel/bpf/verifier.c:8100 [inline] do_check+0xa7f5/0xcb30 kernel/bpf/verifier.c:10117 do_check_common+0x8a4/0x1240 kernel/bpf/verifier.c:11848 do_check_main kernel/bpf/verifier.c:11911 [inline] bpf_check+0xb5e9/0xf2e0 kernel/bpf/verifier.c:12466 bpf_prog_load kernel/bpf/syscall.c:2233 [inline] __do_sys_bpf kernel/bpf/syscall.c:4429 [inline] __se_sys_bpf+0x107a2/0x11cb0 kernel/bpf/syscall.c:4385 __x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:4385 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 8973: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x121/0x160 mm/kasan/common.c:362 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:370 kasan_slab_free include/linux/kasan.h:220 [inline] slab_free_hook mm/slub.c:1595 [inline] slab_free_freelist_hook+0xc0/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc3/0x270 mm/slub.c:4191 pop_stack kernel/bpf/verifier.c:965 [inline] push_stack+0x31c/0x4f0 kernel/bpf/verifier.c:1015 check_cond_jmp_op kernel/bpf/verifier.c:8100 [inline] do_check+0xa7f5/0xcb30 kernel/bpf/verifier.c:10117 do_check_common+0x8a4/0x1240 kernel/bpf/verifier.c:11848 do_check_main kernel/bpf/verifier.c:11911 [inline] bpf_check+0xb5e9/0xf2e0 kernel/bpf/verifier.c:12466 bpf_prog_load kernel/bpf/syscall.c:2233 [inline] __do_sys_bpf kernel/bpf/syscall.c:4429 [inline] __se_sys_bpf+0x107a2/0x11cb0 kernel/bpf/syscall.c:4385 __x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:4385 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff88811518c400 which belongs to the cache kmalloc-192 of size 192 The buggy address is located 112 bytes inside of 192-byte region [ffff88811518c400, ffff88811518c4c0) The buggy address belongs to the page: page:ffffea0004546300 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11518c flags: 0x4000000000000200(slab) raw: 4000000000000200 dead000000000100 dead000000000122 ffff888100043380 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 8973, ts 494794757509, free_ts 494785573312 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2455 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2461 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4253 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5345 allocate_slab mm/slub.c:1808 [inline] new_slab+0x80/0x400 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x302/0x4b0 mm/slub.c:2791 __slab_alloc+0x63/0xa0 mm/slub.c:2831 slab_alloc_node mm/slub.c:2913 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc_trace+0x1bd/0x2e0 mm/slub.c:2972 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] push_stack+0x8e/0x4f0 kernel/bpf/verifier.c:979 check_cond_jmp_op kernel/bpf/verifier.c:8100 [inline] do_check+0xa7f5/0xcb30 kernel/bpf/verifier.c:10117 do_check_common+0x8a4/0x1240 kernel/bpf/verifier.c:11848 do_check_main kernel/bpf/verifier.c:11911 [inline] bpf_check+0xb5e9/0xf2e0 kernel/bpf/verifier.c:12466 bpf_prog_load kernel/bpf/syscall.c:2233 [inline] __do_sys_bpf kernel/bpf/syscall.c:4429 [inline] __se_sys_bpf+0x107a2/0x11cb0 kernel/bpf/syscall.c:4385 __x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:4385 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1348 [inline] free_pcp_prepare mm/page_alloc.c:1420 [inline] free_unref_page_prepare+0x2ae/0x2d0 mm/page_alloc.c:3335 free_unref_page mm/page_alloc.c:3390 [inline] free_the_page+0x9e/0x370 mm/page_alloc.c:5404 __free_pages+0x67/0xc0 mm/page_alloc.c:5415 __vunmap+0x7bc/0x8f0 mm/vmalloc.c:2301 free_work+0x5b/0x80 mm/vmalloc.c:69 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2298 worker_thread+0xaea/0x1510 kernel/workqueue.c:2444 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 :299 Memory state around the buggy address: ffff88811518c300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811518c380: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88811518c400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811518c480: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88811518c500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================