================================================================== 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 ffff88811d7e5470 by task kswapd0/46 CPU: 1 PID: 46 Comm: kswapd0 Tainted: G W 5.15.132-syzkaller-01173-g754f8cc9b7de #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/06/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 kswapd_shrink_node mm/vmscan.c:6721 [inline] balance_pgdat+0x15e1/0x2f50 mm/vmscan.c:6911 kswapd+0x683/0xbf0 mm/vmscan.c:7170 kthread+0x421/0x510 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 12568: 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_track_caller+0x139/0x260 mm/slub.c:4950 kmalloc_reserve net/core/skbuff.c:357 [inline] pskb_expand_head+0x113/0x1240 net/core/skbuff.c:1727 skb_expand_head+0x1df/0x3c0 net/core/skbuff.c:1885 ip6_finish_output2+0x10b2/0x16e0 net/ipv6/ip6_output.c:72 __ip6_finish_output+0x678/0x850 net/ipv6/ip6_output.c:191 ip6_finish_output+0x31/0x210 net/ipv6/ip6_output.c:201 NF_HOOK_COND include/linux/netfilter.h:294 [inline] ip6_output+0x1f7/0x4d0 net/ipv6/ip6_output.c:224 dst_output include/net/dst.h:444 [inline] ip6_local_out+0x1ff/0x480 net/ipv6/output_core.c:161 ip6tunnel_xmit include/net/ip6_tunnel.h:160 [inline] udp_tunnel6_xmit_skb+0x452/0x840 net/ipv6/ip6_udp_tunnel.c:109 send6+0x575/0x850 drivers/net/wireguard/socket.c:152 wg_socket_send_skb_to_peer+0x116/0x1d0 drivers/net/wireguard/socket.c:178 wg_socket_send_buffer_to_peer+0x11a/0x170 drivers/net/wireguard/socket.c:200 wg_packet_send_handshake_initiation drivers/net/wireguard/send.c:40 [inline] wg_packet_handshake_send_worker+0x1d4/0x240 drivers/net/wireguard/send.c:51 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2317 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2464 kthread+0x421/0x510 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Freed by task 0: 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+0x126/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+0xbd/0x190 mm/slub.c:1749 slab_free mm/slub.c:3519 [inline] kfree+0xc8/0x220 mm/slub.c:4579 skb_free_head net/core/skbuff.c:656 [inline] skb_release_data+0x8a9/0xa80 net/core/skbuff.c:678 skb_release_all net/core/skbuff.c:743 [inline] __kfree_skb net/core/skbuff.c:757 [inline] kfree_skb_reason net/core/skbuff.c:778 [inline] kfree_skb+0xba/0x360 net/core/skbuff.c:792 ndisc_error_report+0xb7/0xc0 net/ipv6/ndisc.c:714 neigh_invalidate+0x243/0x470 net/core/neighbour.c:990 neigh_timer_handler+0x778/0xe70 net/core/neighbour.c:1077 call_timer_fn+0x3b/0x2d0 kernel/time/timer.c:1427 expire_timers kernel/time/timer.c:1472 [inline] __run_timers+0x72a/0xa10 kernel/time/timer.c:1743 run_timer_softirq+0x69/0xf0 kernel/time/timer.c:1756 __do_softirq+0x26d/0x5bf kernel/softirq.c:565 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 kvfree_call_rcu+0xb2/0x7d0 kernel/rcu/tree.c:3583 drop_sysctl_table+0x311/0x450 fs/proc/proc_sysctl.c:1682 unregister_sysctl_table+0x7b/0x120 fs/proc/proc_sysctl.c:1720 unregister_net_sysctl_table+0x15/0x20 net/sysctl_net.c:175 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7121 [inline] addrconf_sysctl_unregister net/ipv6/addrconf.c:7149 [inline] addrconf_ifdown+0x178f/0x1ae0 net/ipv6/addrconf.c:3931 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:11082 sit_exit_batch_net+0x620/0x670 net/ipv6/sit.c:1952 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:2317 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2464 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 __call_rcu kernel/rcu/tree.c:2994 [inline] call_rcu+0x133/0x12a0 kernel/rcu/tree.c:3074 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:3934 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:11082 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:2317 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2464 kthread+0x421/0x510 kernel/kthread.c:319 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 The buggy address belongs to the object at ffff88811d7e5000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 1136 bytes inside of 2048-byte region [ffff88811d7e5000, ffff88811d7e5800) The buggy address belongs to the page: page:ffffea000475f800 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11d7e0 head:ffffea000475f800 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 dead000000000100 dead000000000122 ffff888100043200 raw: 0000000000000000 0000000080080008 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 0xd28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 385, ts 104115595452, free_ts 104074887374 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_track_caller+0x16c/0x260 mm/slub.c:4945 kmalloc_reserve net/core/skbuff.c:357 [inline] pskb_expand_head+0x113/0x1240 net/core/skbuff.c:1727 netlink_trim+0x19b/0x230 net/netlink/af_netlink.c:1312 netlink_broadcast_filtered+0x66/0x1220 net/netlink/af_netlink.c:1517 netlink_broadcast net/netlink/af_netlink.c:1562 [inline] nlmsg_multicast include/net/netlink.h:1033 [inline] nlmsg_notify+0x101/0x1c0 net/netlink/af_netlink.c:2548 rtnl_notify net/core/rtnetlink.c:730 [inline] rtmsg_ifinfo_send net/core/rtnetlink.c:3887 [inline] rtmsg_ifinfo_event net/core/rtnetlink.c:3902 [inline] rtnetlink_event+0x15a/0x1b0 net/core/rtnetlink.c:5681 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] dev_set_mac_address+0x325/0x470 net/core/dev.c:9055 dev_set_mac_address_user+0x31/0x50 net/core/dev.c:9069 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 sock_alloc_inode+0x1b/0xb0 net/socket.c:303 alloc_inode fs/inode.c:236 [inline] new_inode_pseudo+0x64/0x220 fs/inode.c:937 Memory state around the buggy address: ffff88811d7e5300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811d7e5380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88811d7e5400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811d7e5480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811d7e5500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================