================================================================== 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+0x6f2/0x760 mm/filemap.c:172 Read of size 4 at addr ffff888130457470 by task syz.3.7483/25014 CPU: 0 PID: 25014 Comm: syz.3.7483 Not tainted 5.15.188-syzkaller-android13-5.15.188_r00 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0xf1/0x140 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+0x6f2/0x760 mm/filemap.c:172 __delete_from_page_cache+0xbe/0x420 mm/filemap.c:240 __remove_mapping+0x60b/0x930 mm/vmscan.c:1216 shrink_page_list+0x2778/0x5040 mm/vmscan.c:1824 shrink_inactive_list mm/vmscan.c:2331 [inline] shrink_list mm/vmscan.c:2576 [inline] shrink_lruvec+0x10f3/0x36a0 mm/vmscan.c:5793 shrink_node_memcgs mm/vmscan.c:5985 [inline] shrink_node+0x11e9/0x2a70 mm/vmscan.c:6015 shrink_zones mm/vmscan.c:6221 [inline] do_try_to_free_pages+0x57e/0x1550 mm/vmscan.c:6279 try_to_free_mem_cgroup_pages+0x233/0x5b0 mm/vmscan.c:6593 try_charge_memcg+0x3da/0x1450 mm/memcontrol.c:2713 try_charge mm/memcontrol.c:2838 [inline] charge_memcg+0x6d/0x1a0 mm/memcontrol.c:6861 __mem_cgroup_charge+0x37/0x130 mm/memcontrol.c:6897 mem_cgroup_charge include/linux/memcontrol.h:715 [inline] shmem_add_to_page_cache+0x62f/0xc30 mm/shmem.c:723 shmem_getpage_gfp+0x1164/0x2310 mm/shmem.c:1946 shmem_getpage mm/shmem.c:156 [inline] shmem_write_begin+0xce/0x1b0 mm/shmem.c:2480 generic_perform_write+0x2ad/0x670 mm/filemap.c:3869 __generic_file_write_iter+0x268/0x480 mm/filemap.c:3997 generic_file_write_iter+0xa9/0x1d0 mm/filemap.c:4029 do_iter_readv_writev+0x491/0x600 fs/read_write.c:-1 do_iter_write+0x1fa/0x7b0 fs/read_write.c:855 vfs_iter_write+0x7d/0xa0 fs/read_write.c:896 iter_file_splice_write+0x650/0xc30 fs/splice.c:689 do_splice_from fs/splice.c:767 [inline] direct_splice_actor+0xe9/0x120 fs/splice.c:936 splice_direct_to_actor+0x4cd/0xb30 fs/splice.c:891 do_splice_direct+0x1b3/0x2c0 fs/splice.c:979 do_sendfile+0x5c6/0xeb0 fs/read_write.c:1249 __do_sys_sendfile64 fs/read_write.c:1317 [inline] __se_sys_sendfile64 fs/read_write.c:1303 [inline] __x64_sys_sendfile64+0x18f/0x1f0 fs/read_write.c:1303 x64_sys_call+0x88d/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:41 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7fba9269b9a9 Code: ff ff c3 66 2e 0f 1f 84 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 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fba90cc2038 EFLAGS: 00000246 ORIG_RAX: 0000000000000028 RAX: ffffffffffffffda RBX: 00007fba928c3160 RCX: 00007fba9269b9a9 RDX: 0000000000000000 RSI: 0000000000000007 RDI: 0000000000000008 RBP: 00007fba9271dd69 R08: 0000000000000000 R09: 0000000000000000 R10: 00000000558410e9 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000000 R14: 00007fba928c3160 R15: 00007ffdf47e5228 Allocated by task 13729: 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:433 [inline] ____kasan_kmalloc mm/kasan/common.c:512 [inline] __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] __kmalloc+0x13d/0x2c0 mm/slub.c:4431 __kmalloc_node include/linux/slab.h:484 [inline] kmalloc_node include/linux/slab.h:639 [inline] kvmalloc_node+0x242/0x330 mm/util.c:628 kvmalloc include/linux/mm.h:851 [inline] kvmalloc_array include/linux/mm.h:869 [inline] alloc_fdtable+0xf2/0x2b0 fs/file.c:132 dup_fd+0x870/0xb20 fs/file.c:336 copy_files+0x76/0xe0 kernel/fork.c:1620 copy_process+0x10ac/0x3210 kernel/fork.c:2336 kernel_clone+0x23f/0x940 kernel/fork.c:2737 __do_sys_clone kernel/fork.c:2863 [inline] __se_sys_clone kernel/fork.c:2847 [inline] __x64_sys_clone+0x176/0x1d0 kernel/fork.c:2847 x64_sys_call+0x41f/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:57 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 24973: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1749 slab_free mm/slub.c:3521 [inline] kfree+0xc4/0x270 mm/slub.c:4583 kvfree+0x35/0x40 mm/util.c:664 __free_fdtable fs/file.c:36 [inline] put_files_struct+0x28e/0x330 fs/file.c:432 exit_files+0x80/0xa0 fs/file.c:445 do_exit+0xa47/0x27a0 kernel/exit.c:884 do_group_exit+0x141/0x310 kernel/exit.c:1003 get_signal+0x66a/0x1480 kernel/signal.c:2907 arch_do_signal_or_restart+0xc1/0x10f0 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0xa7/0xe0 kernel/entry/common.c:178 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x1a/0x30 kernel/entry/common.c:307 do_syscall_64+0x58/0xa0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 insert_work+0x51/0x310 kernel/workqueue.c:1373 __queue_work+0x8e5/0xc60 kernel/workqueue.c:1539 queue_work_on+0xd2/0x140 kernel/workqueue.c:1566 queue_work include/linux/workqueue.h:510 [inline] schedule_work include/linux/workqueue.h:571 [inline] destroy_super_rcu+0xd1/0xe0 fs/super.c:172 rcu_do_batch+0x51d/0xba0 kernel/rcu/tree.c:2523 rcu_core+0x5e4/0xf80 kernel/rcu/tree.c:2763 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776 handle_softirqs+0x250/0x560 kernel/softirq.c:583 __do_softirq kernel/softirq.c:621 [inline] invoke_softirq kernel/softirq.c:443 [inline] __irq_exit_rcu+0x52/0xf0 kernel/softirq.c:670 irq_exit_rcu+0x9/0x10 kernel/softirq.c:682 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1108 [inline] sysvec_apic_timer_interrupt+0xa9/0xc0 arch/x86/kernel/apic/apic.c:1108 asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:676 Second to last potentially related work creation: kasan_save_stack+0x3a/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd2/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu_common kernel/rcu/tree.c:3011 [inline] call_rcu+0x105/0xfe0 kernel/rcu/tree.c:3129 __put_super+0x26b/0x2d0 fs/super.c:299 put_super fs/super.c:313 [inline] deactivate_locked_super+0xd4/0x100 fs/super.c:346 mount_bdev+0x2cc/0x3e0 fs/super.c:1402 f2fs_mount+0x34/0x40 fs/f2fs/super.c:4649 legacy_get_tree+0xed/0x190 fs/fs_context.c:611 vfs_get_tree+0x89/0x260 fs/super.c:1530 do_new_mount+0x25a/0xa20 fs/namespace.c:3014 path_mount+0x675/0x1020 fs/namespace.c:3344 do_mount fs/namespace.c:3357 [inline] __do_sys_mount fs/namespace.c:3565 [inline] __se_sys_mount+0x318/0x380 fs/namespace.c:3542 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3542 x64_sys_call+0x6bf/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:166 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888130457000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1136 bytes inside of 2048-byte region [ffff888130457000, ffff888130457800) The buggy address belongs to the page: page:ffffea0004c11400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x130450 head:ffffea0004c11400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043200 raw: 0000000000000000 0000000000080008 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), pid 14129, ts 1183658420460, free_ts 1180705486800 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5795 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1932 [inline] new_slab+0xa1/0x4d0 mm/slub.c:1995 ___slab_alloc+0x381/0x810 mm/slub.c:3028 __slab_alloc+0x49/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3250 [inline] __kmalloc_track_caller+0x169/0x2c0 mm/slub.c:4949 kmalloc_reserve net/core/skbuff.c:357 [inline] __alloc_skb+0x21a/0x740 net/core/skbuff.c:428 alloc_skb include/linux/skbuff.h:1183 [inline] mld_newpack+0x13a/0x9d0 net/ipv6/mcast.c:1746 add_grhead+0x5e/0x290 net/ipv6/mcast.c:1857 add_grec+0xd41/0x1100 net/ipv6/mcast.c:1995 mld_send_cr net/ipv6/mcast.c:2121 [inline] mld_ifc_work+0x75d/0xbe0 net/ipv6/mcast.c:2659 process_one_work+0x6be/0xba0 kernel/workqueue.c:2325 worker_thread+0xa59/0x1200 kernel/workqueue.c:2472 kthread+0x411/0x500 kernel/kthread.c:337 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x542/0x550 mm/page_alloc.c:3534 free_unref_page+0xa2/0x550 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x6c/0x100 mm/page_alloc.c:5871 free_pages+0x82/0x90 mm/page_alloc.c:5882 free_pg_vec net/packet/af_packet.c:4344 [inline] packet_set_ring+0x18a5/0x2400 net/packet/af_packet.c:4563 packet_release+0x73a/0xc90 net/packet/af_packet.c:3166 __sock_release net/socket.c:649 [inline] sock_close+0xe0/0x270 net/socket.c:1336 __fput+0x20b/0x8b0 fs/file_table.c:311 ____fput+0x15/0x20 fs/file_table.c:339 task_work_run+0x127/0x190 kernel/task_work.c:188 exit_task_work include/linux/task_work.h:33 [inline] do_exit+0xa7e/0x27a0 kernel/exit.c:889 do_group_exit+0x141/0x310 kernel/exit.c:1003 get_signal+0x66a/0x1480 kernel/signal.c:2907 arch_do_signal_or_restart+0xc1/0x10f0 arch/x86/kernel/signal.c:867 handle_signal_work kernel/entry/common.c:154 [inline] exit_to_user_mode_loop+0xa7/0xe0 kernel/entry/common.c:178 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:214 Memory state around the buggy address: ffff888130457300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888130457380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888130457400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888130457480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888130457500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================