================================================================== 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 ffff888115d8b470 by task syz-fuzzer/476 CPU: 1 PID: 476 Comm: syz-fuzzer Not tainted 5.15.130-syzkaller-00623-g1317bd27a72f #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/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:1200 shrink_page_list+0x2723/0x5c50 mm/vmscan.c:1797 shrink_inactive_list mm/vmscan.c:2304 [inline] shrink_list mm/vmscan.c:2549 [inline] shrink_lruvec+0x17ec/0x4580 mm/vmscan.c:5752 shrink_node_memcgs mm/vmscan.c:5944 [inline] shrink_node+0x1077/0x24e0 mm/vmscan.c:5974 shrink_zones mm/vmscan.c:6177 [inline] do_try_to_free_pages+0x5b6/0x1570 mm/vmscan.c:6235 try_to_free_pages+0x3a5/0xd70 mm/vmscan.c:6470 __perform_reclaim mm/page_alloc.c:4946 [inline] __alloc_pages_direct_reclaim mm/page_alloc.c:4969 [inline] __alloc_pages_slowpath+0x160a/0x3860 mm/page_alloc.c:5392 __alloc_pages+0x386/0x5e0 mm/page_alloc.c:5786 __alloc_pages_node include/linux/gfp.h:591 [inline] alloc_pages_node include/linux/gfp.h:605 [inline] alloc_pages include/linux/gfp.h:618 [inline] __read_swap_cache_async+0x23b/0x760 mm/swap_state.c:459 swap_cluster_readahead+0x34b/0x640 mm/swap_state.c:643 swapin_readahead+0x102/0x920 mm/swap_state.c:854 do_swap_page+0x420/0x19f0 mm/memory.c:3786 handle_pte_fault+0x4e6/0x2340 mm/memory.c:4841 do_handle_mm_fault+0x1fed/0x2330 mm/memory.c:5240 handle_mm_fault include/linux/mm.h:1836 [inline] do_user_addr_fault arch/x86/mm/fault.c:1458 [inline] handle_page_fault arch/x86/mm/fault.c:1549 [inline] exc_page_fault+0x3b5/0x830 arch/x86/mm/fault.c:1605 asm_exc_page_fault+0x27/0x30 arch/x86/include/asm/idtentry.h:568 RIP: 0033:0x54c815 Code: ff ff 48 8b 94 24 80 00 00 00 4c 8b 52 38 48 8b 4a 40 48 8b 44 24 58 48 39 c8 0f 8d ba fb ff ff 0f 83 5e 04 00 00 48 8d 34 80 <4d> 8b 04 f2 4c 89 84 24 f0 00 00 00 4d 8d 04 f2 4d 8d 40 08 41 0f RSP: 002b:000000c03346d1f8 EFLAGS: 00010297 RAX: 0000000000000000 RBX: 0000000000000026 RCX: 0000000000000006 RDX: 0000000001a2a920 RSI: 0000000000000000 RDI: 000000c0220c6d10 RBP: 000000c03346d310 R08: 000000c02133cfc0 R09: 000000c01fa64e40 R10: 0000000001c327a0 R11: aa8b5655ad5566b9 R12: ffffffffffffffff R13: 0000000000000036 R14: 000000c0000061a0 R15: 0010000000000000 Allocated by task 412: 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+0xdb/0x110 mm/kasan/common.c:512 __kasan_kmalloc+0x9/0x10 mm/kasan/common.c:521 kasan_kmalloc include/linux/kasan.h:227 [inline] __kmalloc+0x13a/0x270 mm/slub.c:4427 __kmalloc_node include/linux/slab.h:469 [inline] kmalloc_node include/linux/slab.h:626 [inline] kvmalloc_node+0x1f0/0x4d0 mm/util.c:628 kvmalloc include/linux/mm.h:851 [inline] xt_alloc_table_info+0x42/0xb0 net/netfilter/x_tables.c:1192 do_replace net/ipv6/netfilter/ip6_tables.c:1141 [inline] do_ip6t_set_ctl+0xacc/0x3f50 net/ipv6/netfilter/ip6_tables.c:1638 nf_setsockopt+0x274/0x2a0 net/netfilter/nf_sockopt.c:101 ipv6_setsockopt+0x2a07/0x4240 net/ipv6/ipv6_sockglue.c:1011 tcp_setsockopt+0x22d/0x3800 net/ipv4/tcp.c:3695 sock_common_setsockopt+0xa2/0xc0 net/core/sock.c:3439 __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 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 __call_rcu kernel/rcu/tree.c:2994 [inline] call_rcu+0x133/0x12a0 kernel/rcu/tree.c:3074 netlink_release+0x12df/0x16f0 net/netlink/af_netlink.c:819 __sock_release net/socket.c:649 [inline] sock_close+0xdf/0x270 net/socket.c:1317 __fput+0x3fe/0x910 fs/file_table.c:280 ____fput+0x15/0x20 fs/file_table.c:308 task_work_run+0x129/0x190 kernel/task_work.c:164 exit_task_work include/linux/task_work.h:32 [inline] do_exit+0xc60/0x2b60 kernel/exit.c:875 __do_sys_exit kernel/exit.c:966 [inline] __se_sys_exit kernel/exit.c:964 [inline] __ia32_sys_exit+0x0/0x40 kernel/exit.c:964 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 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 insert_work+0x56/0x320 kernel/workqueue.c:1373 __queue_work+0x92a/0xcd0 kernel/workqueue.c:1539 queue_work_on+0x105/0x170 kernel/workqueue.c:1566 queue_work include/linux/workqueue.h:509 [inline] schedule_work include/linux/workqueue.h:570 [inline] destroy_super_rcu+0xd1/0xe0 fs/super.c:172 rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2510 rcu_core+0x517/0x1020 kernel/rcu/tree.c:2750 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2763 __do_softirq+0x26d/0x5bf kernel/softirq.c:565 The buggy address belongs to the object at ffff888115d8b000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1136 bytes inside of 2048-byte region [ffff888115d8b000, ffff888115d8b800) The buggy address belongs to the page: page:ffffea0004576200 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888115d8a000 pfn:0x115d88 head:ffffea0004576200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 ffffea00049d5808 ffffea00043f6c08 ffff888100043200 raw: ffff888115d8a000 0000000000080005 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 412, ts 124094288673, free_ts 120577576357 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2602 prep_new_page+0x1b/0x110 mm/page_alloc.c:2608 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4482 __alloc_pages+0x206/0x5e0 mm/page_alloc.c:5773 allocate_slab mm/slub.c:1932 [inline] new_slab+0x9a/0x4e0 mm/slub.c:1995 ___slab_alloc+0x39e/0x830 mm/slub.c:3028 __slab_alloc+0x4a/0x90 mm/slub.c:3115 slab_alloc_node mm/slub.c:3206 [inline] slab_alloc mm/slub.c:3248 [inline] __kmalloc+0x16d/0x270 mm/slub.c:4423 kmalloc include/linux/slab.h:608 [inline] kzalloc include/linux/slab.h:733 [inline] __register_sysctl_table+0xea/0x1240 fs/proc/proc_sysctl.c:1321 register_net_sysctl+0x21e/0x230 net/sysctl_net.c:169 __addrconf_sysctl_register+0x28f/0x3e0 net/ipv6/addrconf.c:7092 addrconf_sysctl_register+0x141/0x1a0 net/ipv6/addrconf.c:7139 ipv6_add_dev+0xc84/0x1140 net/ipv6/addrconf.c:454 addrconf_notify+0x593/0xdd0 net/ipv6/addrconf.c:3579 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:391 call_netdevice_notifiers_info net/core/dev.c:2005 [inline] call_netdevice_notifiers_extack net/core/dev.c:2017 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2031 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1469 [inline] free_pcp_prepare mm/page_alloc.c:1541 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3531 free_unref_page+0xe6/0x730 mm/page_alloc.c:3613 free_the_page mm/page_alloc.c:802 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5849 __free_slab+0xec/0x1d0 mm/slub.c:2020 free_slab mm/slub.c:2035 [inline] discard_slab mm/slub.c:2041 [inline] __unfreeze_partials+0x165/0x1a0 mm/slub.c:2527 put_cpu_partial+0xc4/0x120 mm/slub.c:2607 __slab_free+0x1c8/0x290 mm/slub.c:3388 do_slab_free mm/slub.c:3507 [inline] ___cache_free+0x109/0x120 mm/slub.c:3526 qlink_free+0x4d/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x44/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x180 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:443 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x53/0x2c0 mm/slab.h:550 slab_alloc_node mm/slub.c:3240 [inline] slab_alloc mm/slub.c:3248 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3253 kmem_cache_alloc_node include/linux/slab.h:474 [inline] alloc_task_struct_node kernel/fork.c:178 [inline] dup_task_struct+0x53/0xc60 kernel/fork.c:932 copy_process+0x5c4/0x3260 kernel/fork.c:2086 Memory state around the buggy address: ffff888115d8b300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888115d8b380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888115d8b400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888115d8b480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888115d8b500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================