================================================================== 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 ffff88810a6d1470 by task syz-executor.2/3506 CPU: 0 PID: 3506 Comm: syz-executor.2 Tainted: G W 5.10.209-syzkaller-00435-gdd976ecce2ce #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/29/2024 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:2068 shrink_list mm/vmscan.c:2287 [inline] shrink_lruvec+0xced/0x3860 mm/vmscan.c:5466 shrink_node_memcgs mm/vmscan.c:5653 [inline] shrink_node+0xdf3/0x1fb0 mm/vmscan.c:5683 shrink_zones mm/vmscan.c:5886 [inline] do_try_to_free_pages+0x67e/0x15e0 mm/vmscan.c:5944 try_to_free_mem_cgroup_pages+0x369/0x830 mm/vmscan.c:6262 try_charge+0x4b8/0x15f0 mm/memcontrol.c:2742 __mem_cgroup_charge+0x147/0x6e0 mm/memcontrol.c:6848 mem_cgroup_charge include/linux/memcontrol.h:458 [inline] __add_to_page_cache_locked+0x29d/0xba0 mm/filemap.c:854 add_to_page_cache_lru+0x117/0x2c0 mm/filemap.c:948 pagecache_get_page+0x71e/0x950 mm/filemap.c:1859 grab_cache_page_write_begin+0x5d/0xa0 mm/filemap.c:3459 ext4_da_write_begin+0x587/0xf60 fs/ext4/inode.c:3055 generic_perform_write+0x2cd/0x570 mm/filemap.c:3509 ext4_buffered_write_iter+0x482/0x610 fs/ext4/file.c:271 ext4_file_write_iter+0x193/0x1c80 fs/ext4/file.c:685 __kernel_write+0x5ab/0x9d0 fs/read_write.c:550 dump_emit+0x261/0x3a0 fs/coredump.c:849 dump_user_range+0x71/0x1a0 fs/coredump.c:902 elf_core_dump+0x33bd/0x3c10 fs/binfmt_elf.c:2287 do_coredump+0x1eb8/0x2d60 fs/coredump.c:811 get_signal+0x102c/0x1410 kernel/signal.c:2768 arch_do_signal_or_restart+0xbd/0x17c0 arch/x86/kernel/signal.c:805 handle_signal_work kernel/entry/common.c:145 [inline] exit_to_user_mode_loop+0x9b/0xd0 kernel/entry/common.c:169 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] irqentry_exit_to_user_mode+0x5a/0x80 kernel/entry/common.c:287 irqentry_exit+0x12/0x60 kernel/entry/common.c:375 exc_page_fault+0x33d/0x5b0 arch/x86/mm/fault.c:1521 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:571 RIP: 0033:0x118a Code: Unable to access opcode bytes at RIP 0x1160. RSP: 002b:00000000200004d8 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f8b033a61f0 RCX: 00007f8b03277da9 RDX: 00000000200001c0 RSI: 00000000200004d0 RDI: 0000000020000000 RBP: 00007f8b032c447a R08: 0000000020000500 R09: 0000000020000500 R10: 0000000020000240 R11: 0000000000000206 R12: 0000000000000000 R13: 000000000000000b R14: 00007f8b033a61f0 R15: 00007ffed35bc658 Allocated by task 3426: 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] __kmalloc+0x1aa/0x330 mm/slub.c:4033 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:664 [inline] __register_sysctl_table+0xea/0x1240 fs/proc/proc_sysctl.c:1321 register_net_sysctl+0x2c/0x40 net/sysctl_net.c:121 __devinet_sysctl_register+0x1d3/0x2a0 net/ipv4/devinet.c:2572 devinet_sysctl_register+0x16a/0x1e0 net/ipv4/devinet.c:2612 inetdev_init+0x25f/0x460 net/ipv4/devinet.c:276 inetdev_event+0x205/0x1040 net/ipv4/devinet.c:1531 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2080 register_netdevice+0x1066/0x13f0 net/core/dev.c:10067 __ip_tunnel_create+0x2b0/0x370 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x28d/0x750 net/ipv4/ip_tunnel.c:1069 ipgre_init_net+0x24/0x30 net/ipv4/ip_gre.c:1024 ops_init+0x1cf/0x4a0 net/core/net_namespace.c:141 setup_net+0x367/0xbf0 net/core/net_namespace.c:342 copy_net_ns+0x331/0x520 net/core/net_namespace.c:483 create_new_namespaces+0x410/0x660 kernel/nsproxy.c:110 copy_namespaces+0x1d1/0x220 kernel/nsproxy.c:179 copy_process+0x11a0/0x3340 kernel/fork.c:2186 kernel_clone+0x21e/0x9e0 kernel/fork.c:2574 __do_sys_clone3 kernel/fork.c:2858 [inline] __se_sys_clone3 kernel/fork.c:2842 [inline] __x64_sys_clone3+0x376/0x3a0 kernel/fork.c:2842 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 24798: 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] kmem_cache_free_bulk+0x29f/0x590 mm/slub.c:3336 kfree_bulk include/linux/slab.h:409 [inline] kfree_rcu_work+0x2a4/0x680 kernel/rcu/tree.c:3238 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 kvfree_call_rcu+0x136/0x650 kernel/rcu/tree.c:3535 drop_sysctl_table+0x311/0x450 fs/proc/proc_sysctl.c:1682 unregister_sysctl_table+0x76/0x120 fs/proc/proc_sysctl.c:1720 unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:127 __devinet_sysctl_unregister net/ipv4/devinet.c:2595 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2623 [inline] inetdev_destroy net/ipv4/devinet.c:324 [inline] inetdev_event+0x76f/0x1040 net/ipv4/devinet.c:1599 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers net/core/dev.c:2080 [inline] unregister_netdevice_many+0xde7/0x17d0 net/core/dev.c:10746 ip_tunnel_delete_nets+0x33b/0x380 net/ipv4/ip_tunnel.c:1122 ipgre_exit_batch_net+0x22/0x30 net/ipv4/ip_gre.c:1029 ops_exit_list net/core/net_namespace.c:187 [inline] setup_net+0x7ce/0xbf0 net/core/net_namespace.c:365 copy_net_ns+0x331/0x520 net/core/net_namespace.c:483 create_new_namespaces+0x410/0x660 kernel/nsproxy.c:110 copy_namespaces+0x1d1/0x220 kernel/nsproxy.c:179 copy_process+0x11a0/0x3340 kernel/fork.c:2186 kernel_clone+0x21e/0x9e0 kernel/fork.c:2574 __do_sys_clone3 kernel/fork.c:2858 [inline] __se_sys_clone3 kernel/fork.c:2842 [inline] __x64_sys_clone3+0x376/0x3a0 kernel/fork.c:2842 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Second to last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:38 __kasan_record_aux_stack+0xd3/0x100 mm/kasan/generic.c:348 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:358 kvfree_call_rcu+0x136/0x650 kernel/rcu/tree.c:3535 drop_sysctl_table+0x311/0x450 fs/proc/proc_sysctl.c:1682 unregister_sysctl_table+0x76/0x120 fs/proc/proc_sysctl.c:1720 unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:127 __devinet_sysctl_unregister net/ipv4/devinet.c:2595 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2623 [inline] inetdev_destroy net/ipv4/devinet.c:324 [inline] inetdev_event+0x76f/0x1040 net/ipv4/devinet.c:1599 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 call_netdevice_notifiers_info net/core/dev.c:2054 [inline] call_netdevice_notifiers_extack net/core/dev.c:2066 [inline] call_netdevice_notifiers net/core/dev.c:2080 [inline] unregister_netdevice_many+0xde7/0x17d0 net/core/dev.c:10746 ip_tunnel_delete_nets+0x33b/0x380 net/ipv4/ip_tunnel.c:1122 vti_exit_batch_net+0x22/0x30 net/ipv4/ip_vti.c:512 ops_exit_list net/core/net_namespace.c:187 [inline] cleanup_net+0x6e9/0xcb0 net/core/net_namespace.c:606 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2301 worker_thread+0xaea/0x1510 kernel/workqueue.c:2447 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299 The buggy address belongs to the object at ffff88810a6d1000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1136 bytes inside of 2048-byte region [ffff88810a6d1000, ffff88810a6d1800) The buggy address belongs to the page: page:ffffea000429b400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10a6d0 head:ffffea000429b400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 0000000000000000 0000000100000001 ffff888100042d80 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 375, ts 107276139317, free_ts 107269236833 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5346 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] __kmalloc_track_caller+0x1f8/0x320 mm/slub.c:4536 __kmalloc_reserve net/core/skbuff.c:143 [inline] __alloc_skb+0xbc/0x510 net/core/skbuff.c:211 alloc_skb include/linux/skbuff.h:1126 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet6_ifinfo_notify+0x70/0x110 net/ipv6/addrconf.c:6021 addrconf_notify+0xa48/0xe90 net/ipv6/addrconf.c:3674 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 __dev_notify_flags+0x304/0x610 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8590 do_setlink+0xc5c/0x3c10 net/core/rtnetlink.c:2729 __rtnl_newlink net/core/rtnetlink.c:3407 [inline] rtnl_newlink+0x15f0/0x2000 net/core/rtnetlink.c:3527 rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5608 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1349 [inline] __free_pages_ok+0x82c/0x850 mm/page_alloc.c:1629 free_the_page+0x76/0x370 mm/page_alloc.c:5407 __free_pages+0x67/0xc0 mm/page_alloc.c:5416 __free_slab+0xcf/0x190 mm/slub.c:1894 free_slab mm/slub.c:1909 [inline] discard_slab mm/slub.c:1915 [inline] unfreeze_partials+0x15e/0x190 mm/slub.c:2410 put_cpu_partial+0xbf/0x180 mm/slub.c:2446 __slab_free+0x2c8/0x3a0 mm/slub.c:3095 do_slab_free mm/slub.c:3191 [inline] ___cache_free+0x111/0x130 mm/slub.c:3210 qlink_free+0x50/0x90 mm/kasan/quarantine.c:157 qlist_free_all+0x47/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x15a/0x170 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:440 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x61/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x168/0x2e0 mm/slub.c:2960 kmem_cache_zalloc include/linux/slab.h:654 [inline] __kernfs_new_node+0xdb/0x700 fs/kernfs/dir.c:662 kernfs_new_node fs/kernfs/dir.c:727 [inline] kernfs_create_dir_ns+0x9b/0x230 fs/kernfs/dir.c:1075 Memory state around the buggy address: ffff88810a6d1300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810a6d1380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810a6d1400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810a6d1480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810a6d1500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================