================================================================== 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 ffff88810a4f0470 by task syz-executor.5/7019 CPU: 1 PID: 7019 Comm: syz-executor.5 Tainted: G W 5.15.106-syzkaller-00249-g19c0ed55a470 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/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:1197 shrink_page_list+0x25f1/0x5820 mm/vmscan.c:1789 shrink_inactive_list mm/vmscan.c:2261 [inline] shrink_list mm/vmscan.c:2506 [inline] shrink_lruvec+0x17e9/0x4340 mm/vmscan.c:5694 shrink_node_memcgs mm/vmscan.c:5886 [inline] shrink_node+0x1077/0x24e0 mm/vmscan.c:5916 shrink_zones mm/vmscan.c:6119 [inline] do_try_to_free_pages+0x5b6/0x1570 mm/vmscan.c:6177 try_to_free_mem_cgroup_pages+0x36c/0x850 mm/vmscan.c:6491 memory_max_write+0x265/0x470 mm/memcontrol.c:6431 cgroup_file_write+0x290/0x590 kernel/cgroup/cgroup.c:3943 kernfs_fop_write_iter+0x2c4/0x410 fs/kernfs/file.c:296 call_write_iter include/linux/fs.h:2159 [inline] new_sync_write fs/read_write.c:507 [inline] vfs_write+0xd8a/0x1160 fs/read_write.c:594 ksys_write+0x199/0x2c0 fs/read_write.c:647 __do_sys_write fs/read_write.c:659 [inline] __se_sys_write fs/read_write.c:656 [inline] __x64_sys_write+0x7b/0x90 fs/read_write.c:656 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 RIP: 0033:0x7f191cc89199 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:00007f191b9fc168 EFLAGS: 00000246 ORIG_RAX: 0000000000000001 RAX: ffffffffffffffda RBX: 00007f191cda8f80 RCX: 00007f191cc89199 RDX: 0000000000000012 RSI: 0000000020000140 RDI: 0000000000000006 RBP: 00007f191cce4ca1 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007fff50c6e45f R14: 00007f191b9fc300 R15: 0000000000022000 Allocated by task 6876: 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] kmem_cache_alloc_trace+0x115/0x210 mm/slub.c:3265 kmalloc include/linux/slab.h:608 [inline] kzalloc include/linux/slab.h:738 [inline] copy_verifier_state+0x57a/0xcc0 kernel/bpf/verifier.c:969 push_stack+0x19d/0x4f0 kernel/bpf/verifier.c:1045 check_cond_jmp_op kernel/bpf/verifier.c:9070 [inline] do_check+0xb0dd/0xd420 kernel/bpf/verifier.c:11185 do_check_common+0x87d/0x1180 kernel/bpf/verifier.c:13190 do_check_main kernel/bpf/verifier.c:13253 [inline] bpf_check+0x3667/0x128f0 kernel/bpf/verifier.c:13820 bpf_prog_load+0x12ac/0x1b50 kernel/bpf/syscall.c:2327 __sys_bpf+0x4bc/0x760 kernel/bpf/syscall.c:4618 __do_sys_bpf kernel/bpf/syscall.c:4722 [inline] __se_sys_bpf kernel/bpf/syscall.c:4720 [inline] __x64_sys_bpf+0x7c/0x90 kernel/bpf/syscall.c:4720 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:2993 [inline] call_rcu+0x133/0x12a0 kernel/rcu/tree.c:3073 in6_dev_finish_destroy+0x15a/0x1b0 net/ipv6/addrconf_core.c:271 in6_dev_put include/net/addrconf.h:390 [inline] addrconf_ifdown+0x1893/0x1ae0 net/ipv6/addrconf.c:3929 addrconf_notify+0x37d/0xdd0 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 net/core/dev.c:2031 [inline] unregister_netdevice_many+0xe0a/0x17c0 net/core/dev.c:11080 vti6_exit_batch_net+0x260/0x2a0 net/ipv6/ip6_vti.c:1190 ops_exit_list net/core/net_namespace.c:174 [inline] cleanup_net+0x6ce/0xc00 net/core/net_namespace.c:596 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2313 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2460 kthread+0x421/0x510 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 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:1369 __queue_work+0x923/0xcd0 kernel/workqueue.c:1535 queue_work_on+0x105/0x170 kernel/workqueue.c:1562 queue_work include/linux/workqueue.h:507 [inline] schedule_work include/linux/workqueue.h:568 [inline] destroy_super_rcu+0xd1/0xe0 fs/super.c:172 rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2509 rcu_core+0x517/0x1020 kernel/rcu/tree.c:2749 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2762 __do_softirq+0x26d/0x5bf kernel/softirq.c:565 The buggy address belongs to the object at ffff88810a4f0000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1136 bytes inside of 2048-byte region [ffff88810a4f0000, ffff88810a4f0800) The buggy address belongs to the page: page:ffffea0004293c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88810a4f0000 pfn:0x10a4f0 head:ffffea0004293c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 ffffea0004633008 ffffea0004536208 ffff888100043200 raw: ffff88810a4f0000 0000000000080007 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 415, ts 134697431050, free_ts 134678287384 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2502 prep_new_page mm/page_alloc.c:2508 [inline] get_page_from_freelist+0x2c14/0x2cf0 mm/page_alloc.c:4291 __alloc_pages+0x386/0x7b0 mm/page_alloc.c:5569 allocate_slab mm/slub.c:1930 [inline] new_slab+0x92/0x490 mm/slub.c:1993 ___slab_alloc+0x39e/0x830 mm/slub.c:3026 __slab_alloc+0x4a/0x90 mm/slub.c:3113 slab_alloc_node mm/slub.c:3204 [inline] slab_alloc mm/slub.c:3246 [inline] kmem_cache_alloc_trace+0x142/0x210 mm/slub.c:3263 kmalloc include/linux/slab.h:608 [inline] kzalloc include/linux/slab.h:738 [inline] ipv6_add_dev+0xd1/0x1140 net/ipv6/addrconf.c:385 ipv6_find_idev net/ipv6/addrconf.c:491 [inline] inet6_rtm_newaddr+0x679/0x26b0 net/ipv6/addrconf.c:4930 rtnetlink_rcv_msg+0x951/0xc40 net/core/rtnetlink.c:5587 netlink_rcv_skb+0x1cf/0x410 net/netlink/af_netlink.c:2533 rtnetlink_rcv+0x1c/0x20 net/core/rtnetlink.c:5605 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x8df/0xac0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0xa0a/0xd20 net/netlink/af_netlink.c:1952 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] __sys_sendto+0x564/0x720 net/socket.c:2039 __do_sys_sendto net/socket.c:2051 [inline] __se_sys_sendto net/socket.c:2047 [inline] __x64_sys_sendto+0xe5/0x100 net/socket.c:2047 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1370 [inline] free_pcp_prepare mm/page_alloc.c:1442 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3441 free_unref_page+0xac/0x2c0 mm/page_alloc.c:3521 free_the_page mm/page_alloc.c:711 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5645 __free_slab+0xec/0x1d0 mm/slub.c:2018 free_slab mm/slub.c:2033 [inline] discard_slab+0x29/0x40 mm/slub.c:2039 __slab_free+0x205/0x290 mm/slub.c:3422 do_slab_free mm/slub.c:3505 [inline] ___cache_free+0x109/0x120 mm/slub.c:3524 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:3238 [inline] slab_alloc mm/slub.c:3246 [inline] kmem_cache_alloc+0xf5/0x200 mm/slub.c:3251 kmem_cache_alloc_node include/linux/slab.h:479 [inline] __alloc_skb+0xbe/0x550 net/core/skbuff.c:416 alloc_skb include/linux/skbuff.h:1182 [inline] netlink_alloc_large_skb net/netlink/af_netlink.c:1202 [inline] netlink_sendmsg+0x797/0xd20 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg net/socket.c:724 [inline] __sys_sendto+0x564/0x720 net/socket.c:2039 Memory state around the buggy address: ffff88810a4f0300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810a4f0380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88810a4f0400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810a4f0480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810a4f0500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================