================================================================== 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+0x9e0/0xac0 mm/filemap.c:175 Read of size 4 at addr ffff88811b483470 by task syz.3.6857/23889 CPU: 0 PID: 23889 Comm: syz.3.6857 Tainted: G W 5.10.236-syzkaller-00012-gab07aeb2c93d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:435 [inline] kasan_report+0xe2/0x130 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+0x9e0/0xac0 mm/filemap.c:175 __delete_from_page_cache+0xc4/0x460 mm/filemap.c:243 __remove_mapping+0x562/0x690 mm/vmscan.c:985 shrink_page_list+0x2109/0x4120 mm/vmscan.c:1498 shrink_inactive_list+0x4f4/0xe80 mm/vmscan.c:2075 shrink_list mm/vmscan.c:2294 [inline] shrink_lruvec+0x2246/0x2770 mm/vmscan.c:5473 shrink_node_memcgs mm/vmscan.c:5660 [inline] shrink_node+0xf0c/0x2690 mm/vmscan.c:5690 shrink_zones mm/vmscan.c:5896 [inline] do_try_to_free_pages+0x5db/0x1560 mm/vmscan.c:5954 try_to_free_mem_cgroup_pages+0x233/0x5b0 mm/vmscan.c:6272 try_charge+0x42b/0x14e0 mm/memcontrol.c:2747 __mem_cgroup_charge+0x14c/0x6d0 mm/memcontrol.c:6873 mem_cgroup_charge include/linux/memcontrol.h:458 [inline] shmem_add_to_page_cache+0x55e/0xe10 mm/shmem.c:699 shmem_getpage_gfp+0x8e8/0x2110 mm/shmem.c:1952 shmem_getpage mm/shmem.c:161 [inline] shmem_write_begin+0xce/0x1b0 mm/shmem.c:2497 generic_perform_write+0x2be/0x510 mm/filemap.c:3509 __generic_file_write_iter+0x24b/0x480 mm/filemap.c:3638 generic_file_write_iter+0xa9/0x1d0 mm/filemap.c:3670 __kernel_write+0x55a/0x910 fs/read_write.c:550 dump_emit+0x240/0x360 fs/coredump.c:849 dump_user_range+0x6a/0x1a0 fs/coredump.c:902 elf_core_dump+0x278a/0x2bc0 fs/binfmt_elf.c:2290 do_coredump+0x1ac9/0x27f0 fs/coredump.c:811 get_signal+0xf23/0x12e0 kernel/signal.c:2779 arch_do_signal_or_restart+0xbf/0x10f0 arch/x86/kernel/signal.c:805 handle_signal_work kernel/entry/common.c:145 [inline] exit_to_user_mode_loop+0xa2/0xe0 kernel/entry/common.c:169 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] irqentry_exit_to_user_mode+0x4e/0x80 kernel/entry/common.c:287 irqentry_exit+0x12/0x60 kernel/entry/common.c:375 exc_general_protection+0x1ca/0x250 arch/x86/kernel/traps.c:557 asm_exc_general_protection+0x1e/0x30 arch/x86/include/asm/idtentry.h:565 RIP: 0033:0x7f0c8cb13971 Code: 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 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:0000200000000250 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f0c8cd3afa0 RCX: 00007f0c8cb13969 RDX: 0000200000000280 RSI: 0000200000000250 RDI: 0000000000000600 RBP: 00007f0c8cb95ab1 R08: 0000200000000a80 R09: 0000200000000a80 R10: 0000200000000300 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f0c8cd3afa0 R15: 00007ffc7e9effc8 Allocated by task 23179: 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 mm/kasan/common.c:509 [inline] __kasan_kmalloc+0xda/0x110 mm/kasan/common.c:518 kasan_kmalloc include/linux/kasan.h:254 [inline] kmem_cache_alloc_trace+0x184/0x2e0 mm/slub.c:2974 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] alloc_super+0x5e/0x7a0 fs/super.c:203 sget+0x1e4/0x4c0 fs/super.c:627 mount_bdev+0xf6/0x3a0 fs/super.c:1415 f2fs_mount+0x34/0x40 fs/f2fs/super.c:4548 legacy_get_tree+0xed/0x190 fs/fs_context.c:593 vfs_get_tree+0x89/0x260 fs/super.c:1572 do_new_mount+0x25a/0xa20 fs/namespace.c:2917 path_mount+0x572/0xc80 fs/namespace.c:3247 do_mount fs/namespace.c:3260 [inline] __do_sys_mount fs/namespace.c:3468 [inline] __se_sys_mount+0x318/0x380 fs/namespace.c:3445 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3445 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb Freed by task 23742: 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: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+0xc5/0x190 mm/slub.c:1621 slab_free mm/slub.c:3203 [inline] kfree+0xc0/0x270 mm/slub.c:4191 skb_free_head net/core/skbuff.c:606 [inline] skb_release_data+0x532/0x670 net/core/skbuff.c:626 skb_release_all net/core/skbuff.c:680 [inline] __kfree_skb net/core/skbuff.c:694 [inline] kfree_skb+0xb9/0x2f0 net/core/skbuff.c:713 ip6gre_tunnel_xmit+0xbc9/0x1090 net/ipv6/ip6_gre.c:931 __netdev_start_xmit include/linux/netdevice.h:4864 [inline] netdev_start_xmit include/linux/netdevice.h:4878 [inline] xmit_one net/core/dev.c:3607 [inline] dev_hard_start_xmit+0x244/0x670 net/core/dev.c:3623 sch_direct_xmit+0x24b/0x8b0 net/sched/sch_generic.c:336 qdisc_restart net/sched/sch_generic.c:401 [inline] __qdisc_run+0x9be/0x1330 net/sched/sch_generic.c:409 qdisc_run+0x10a/0x300 include/net/pkt_sched.h:127 __dev_xmit_skb net/core/dev.c:3818 [inline] __dev_queue_xmit+0xbc7/0x2540 net/core/dev.c:4174 dev_queue_xmit+0x17/0x20 net/core/dev.c:4242 neigh_hh_output include/net/neighbour.h:501 [inline] neigh_output include/net/neighbour.h:515 [inline] ip6_finish_output2+0xe94/0x1500 net/ipv6/ip6_output.c:130 __ip6_finish_output+0x5ff/0x790 net/ipv6/ip6_output.c:201 ip6_finish_output+0x33/0x1f0 net/ipv6/ip6_output.c:211 NF_HOOK_COND include/linux/netfilter.h:288 [inline] ip6_output+0x1d1/0x3b0 net/ipv6/ip6_output.c:234 dst_output include/net/dst.h:451 [inline] NF_HOOK include/linux/netfilter.h:299 [inline] mld_sendpack+0x5e6/0xa80 net/ipv6/mcast.c:1676 mld_send_cr net/ipv6/mcast.c:1972 [inline] mld_ifc_timer_expire+0x84a/0xc50 net/ipv6/mcast.c:2471 call_timer_fn+0x38/0x290 kernel/time/timer.c:1450 expire_timers kernel/time/timer.c:1495 [inline] __run_timers+0x639/0x9a0 kernel/time/timer.c:1789 run_timer_softirq+0x6a/0xf0 kernel/time/timer.c:1802 __do_softirq+0x255/0x563 kernel/softirq.c:309 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+0x52/0x310 kernel/workqueue.c:1352 __queue_work+0x923/0xca0 kernel/workqueue.c:1518 queue_work_on+0xd5/0x130 kernel/workqueue.c:1545 queue_work include/linux/workqueue.h:515 [inline] schedule_work include/linux/workqueue.h:576 [inline] destroy_super_rcu+0xd1/0xe0 fs/super.c:172 rcu_do_batch+0x4df/0xa80 kernel/rcu/tree.c:2494 rcu_core+0x55f/0xd60 kernel/rcu/tree.c:2735 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2748 __do_softirq+0x255/0x563 kernel/softirq.c:309 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 kernel/rcu/tree.c:2976 [inline] call_rcu+0x105/0x1040 kernel/rcu/tree.c:3050 __put_super+0x254/0x2b0 fs/super.c:299 put_super fs/super.c:313 [inline] deactivate_locked_super+0xd4/0x100 fs/super.c:346 mount_bdev+0x2a9/0x3a0 fs/super.c:1444 f2fs_mount+0x34/0x40 fs/f2fs/super.c:4548 legacy_get_tree+0xed/0x190 fs/fs_context.c:593 vfs_get_tree+0x89/0x260 fs/super.c:1572 do_new_mount+0x25a/0xa20 fs/namespace.c:2917 path_mount+0x572/0xc80 fs/namespace.c:3247 do_mount fs/namespace.c:3260 [inline] __do_sys_mount fs/namespace.c:3468 [inline] __se_sys_mount+0x318/0x380 fs/namespace.c:3445 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3445 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88811b483000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1136 bytes inside of 2048-byte region [ffff88811b483000, ffff88811b483800) The buggy address belongs to the page: page:ffffea00046d2000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11b480 head:ffffea00046d2000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 ffffea00043d4400 0000000200000002 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 22668, ts 1134542592806, free_ts 1130616679774 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2456 [inline] prep_new_page+0x179/0x180 mm/page_alloc.c:2462 get_page_from_freelist+0x2235/0x23d0 mm/page_alloc.c:4254 __alloc_pages_nodemask+0x268/0x5f0 mm/page_alloc.c:5349 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1808 [inline] new_slab+0x84/0x3f0 mm/slub.c:1869 new_slab_objects mm/slub.c:2627 [inline] ___slab_alloc+0x2a6/0x450 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+0x1b3/0x2e0 mm/slub.c:2972 kmalloc include/linux/slab.h:552 [inline] kzalloc include/linux/slab.h:664 [inline] copy_verifier_state+0x5a2/0xc20 kernel/bpf/verifier.c:913 push_stack+0x19b/0x4f0 kernel/bpf/verifier.c:989 check_cond_jmp_op kernel/bpf/verifier.c:8286 [inline] do_check+0xb7df/0xdf40 kernel/bpf/verifier.c:10313 do_check_common+0x8e3/0x1160 kernel/bpf/verifier.c:12047 do_check_main kernel/bpf/verifier.c:12110 [inline] bpf_check+0x9371/0xd720 kernel/bpf/verifier.c:12665 bpf_prog_load+0xf5a/0x1420 kernel/bpf/syscall.c:2231 __do_sys_bpf kernel/bpf/syscall.c:4432 [inline] __se_sys_bpf+0x442/0x680 kernel/bpf/syscall.c:4388 __x64_sys_bpf+0x7b/0x90 kernel/bpf/syscall.c:4388 do_syscall_64+0x31/0x40 arch/x86/entry/common.c:46 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+0x7fc/0x820 mm/page_alloc.c:1629 free_the_page mm/page_alloc.c:5410 [inline] __free_pages+0xdd/0x380 mm/page_alloc.c:5419 __free_slab+0xcf/0x190 mm/slub.c:1894 free_slab mm/slub.c:1909 [inline] discard_slab+0x29/0x40 mm/slub.c:1915 __slab_free+0x313/0x3a0 mm/slub.c:3131 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+0x5f/0xb0 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x14a/0x160 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x2f/0xf0 mm/kasan/common.c:440 kasan_slab_alloc include/linux/kasan.h:244 [inline] slab_post_alloc_hook+0x5d/0x2f0 mm/slab.h:583 slab_alloc_node mm/slub.c:2947 [inline] slab_alloc mm/slub.c:2955 [inline] kmem_cache_alloc+0x165/0x2e0 mm/slub.c:2960 kmem_cache_alloc_node include/linux/slab.h:423 [inline] __alloc_skb+0x9e/0x520 net/core/skbuff.c:200 alloc_skb include/linux/skbuff.h:1126 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet_netconf_notify_devconf+0x169/0x220 net/ipv4/devinet.c:2121 __devinet_sysctl_unregister net/ipv4/devinet.c:2626 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2650 [inline] inetdev_destroy net/ipv4/devinet.c:326 [inline] inetdev_event+0x7c6/0x1030 net/ipv4/devinet.c:1613 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x90/0x100 kernel/notifier.c:410 Memory state around the buggy address: ffff88811b483300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811b483380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88811b483400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811b483480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811b483500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== syz.3.6857 invoked oom-killer: gfp_mask=0xcc0(GFP_KERNEL), order=0, oom_score_adj=1000 CPU: 0 PID: 23889 Comm: syz.3.6857 Tainted: G B W 5.10.236-syzkaller-00012-gab07aeb2c93d #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2025 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:77 dump_stack_lvl+0x169/0x1d8 lib/dump_stack.c:118 dump_stack+0x15/0x1c lib/dump_stack.c:135 dump_header+0xdd/0x650 mm/oom_kill.c:508 oom_kill_process+0x1fa/0x2c0 mm/oom_kill.c:1038 out_of_memory+0x94a/0xd70 mm/oom_kill.c:1181 mem_cgroup_out_of_memory+0x260/0x310 mm/memcontrol.c:1738 mem_cgroup_oom mm/memcontrol.c:1973 [inline] try_charge+0xf61/0x14e0 mm/memcontrol.c:2798 __mem_cgroup_charge+0x14c/0x6d0 mm/memcontrol.c:6873 mem_cgroup_charge include/linux/memcontrol.h:458 [inline] shmem_add_to_page_cache+0x55e/0xe10 mm/shmem.c:699 shmem_getpage_gfp+0x8e8/0x2110 mm/shmem.c:1952 shmem_getpage mm/shmem.c:161 [inline] shmem_write_begin+0xce/0x1b0 mm/shmem.c:2497 generic_perform_write+0x2be/0x510 mm/filemap.c:3509 __generic_file_write_iter+0x24b/0x480 mm/filemap.c:3638 generic_file_write_iter+0xa9/0x1d0 mm/filemap.c:3670 __kernel_write+0x55a/0x910 fs/read_write.c:550 dump_emit+0x240/0x360 fs/coredump.c:849 dump_user_range+0x6a/0x1a0 fs/coredump.c:902 elf_core_dump+0x278a/0x2bc0 fs/binfmt_elf.c:2290 do_coredump+0x1ac9/0x27f0 fs/coredump.c:811 get_signal+0xf23/0x12e0 kernel/signal.c:2779 arch_do_signal_or_restart+0xbf/0x10f0 arch/x86/kernel/signal.c:805 handle_signal_work kernel/entry/common.c:145 [inline] exit_to_user_mode_loop+0xa2/0xe0 kernel/entry/common.c:169 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] irqentry_exit_to_user_mode+0x4e/0x80 kernel/entry/common.c:287 irqentry_exit+0x12/0x60 kernel/entry/common.c:375 exc_general_protection+0x1ca/0x250 arch/x86/kernel/traps.c:557 asm_exc_general_protection+0x1e/0x30 arch/x86/include/asm/idtentry.h:565 RIP: 0033:0x7f0c8cb13971 Code: 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 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f RSP: 002b:0000200000000250 EFLAGS: 00010217 RAX: 0000000000000000 RBX: 00007f0c8cd3afa0 RCX: 00007f0c8cb13969 RDX: 0000200000000280 RSI: 0000200000000250 RDI: 0000000000000600 RBP: 00007f0c8cb95ab1 R08: 0000200000000a80 R09: 0000200000000a80 R10: 0000200000000300 R11: 0000000000000206 R12: 0000000000000000 R13: 0000000000000000 R14: 00007f0c8cd3afa0 R15: 00007ffc7e9effc8 memory: usage 238368kB, limit 307200kB, failcnt 19639 memory+swap: usage 311056kB, limit 9007199254740988kB, failcnt 0 kmem: usage 0kB, limit 9007199254740988kB, failcnt 0 Memory cgroup stats for /syz3: anon 270336 file 231272448 kernel_stack 0 percpu 0 sock 0 shmem 227217408 file_mapped 135168 file_dirty 0 file_writeback 0 anon_thp 0 inactive_anon 225370112 active_anon 6352896 inactive_file 98304 active_file 3989504 unevictable 0 slab_reclaimable 0 slab_unreclaimable 0 slab 0 workingset_refault_anon 33 workingset_refault_file 2904 workingset_activate_anon 0 workingset_activate_file 2211 workingset_restore_anon 0 workingset_restore_file 1914 oom-kill:constraint=CONSTRAINT_MEMCG,nodemask=(null),cpuset=syz3,mems_allowed=0,oom_memcg=/syz3,task_memcg=/syz3,task=syz.3.6857,pid=23896,uid=0 Memory cgroup out of memory: Killed process 23896 (syz.3.6857) total-vm:90028kB, anon-rss:996kB, file-rss:53312kB, shmem-rss:0kB, UID:0 pgtables:184kB oom_score_adj:1000