================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic64_try_cmpxchg_acquire include/asm-generic/atomic-instrumented.h:1515 [inline] BUG: KASAN: use-after-free in atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:443 [inline] BUG: KASAN: use-after-free in __down_read_trylock kernel/locking/rwsem.c:1393 [inline] BUG: KASAN: use-after-free in down_read_trylock+0xba/0x1d0 kernel/locking/rwsem.c:1553 Write of size 8 at addr ffff88811fa74070 by task kworker/u4:0/30735 CPU: 0 PID: 30735 Comm: kworker/u4:0 Not tainted 5.10.187-syzkaller-00057-g8a427269c016 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2023 Workqueue: writeback wb_workfn (flush-7:4) 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 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic64_try_cmpxchg_acquire include/asm-generic/atomic-instrumented.h:1515 [inline] atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:443 [inline] __down_read_trylock kernel/locking/rwsem.c:1393 [inline] down_read_trylock+0xba/0x1d0 kernel/locking/rwsem.c:1553 trylock_super+0x1f/0xf0 fs/super.c:418 __writeback_inodes_wb fs/fs-writeback.c:1795 [inline] wb_writeback+0x49d/0xc60 fs/fs-writeback.c:1910 wb_check_old_data_flush fs/fs-writeback.c:2012 [inline] wb_do_writeback fs/fs-writeback.c:2065 [inline] wb_workfn+0xb3d/0x1110 fs/fs-writeback.c:2094 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2298 worker_thread+0xaea/0x1510 kernel/workqueue.c:2444 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299 Allocated by task 31282: 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 __addrconf_sysctl_register+0x28f/0x3e0 net/ipv6/addrconf.c:7003 addrconf_sysctl_register+0x141/0x1a0 net/ipv6/addrconf.c:7050 ipv6_add_dev+0xc11/0x10b0 net/ipv6/addrconf.c:447 addrconf_notify+0x58e/0xe90 net/ipv6/addrconf.c:3540 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:10059 register_netdev+0x3c/0x50 net/core/dev.c:10152 loopback_net_init+0x74/0x150 drivers/net/loopback.c:216 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:2178 kernel_clone+0x21e/0x9e0 kernel/fork.c:2571 __do_sys_clone3 kernel/fork.c:2855 [inline] __se_sys_clone3 kernel/fork.c:2839 [inline] __x64_sys_clone3+0x376/0x3a0 kernel/fork.c:2839 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 16932: 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:3237 process_one_work+0x6dc/0xbd0 kernel/workqueue.c:2298 worker_thread+0xaea/0x1510 kernel/workqueue.c:2444 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:3534 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 __addrconf_sysctl_unregister net/ipv6/addrconf.c:7032 [inline] addrconf_sysctl_unregister net/ipv6/addrconf.c:7060 [inline] addrconf_ifdown+0x1769/0x1a60 net/ipv6/addrconf.c:3909 addrconf_notify+0x378/0xe90 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:10738 default_device_exit_batch+0x38a/0x3f0 net/core/dev.c:11258 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:2298 worker_thread+0xaea/0x1510 kernel/workqueue.c:2444 kthread+0x34b/0x3d0 kernel/kthread.c:313 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:299 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 insert_work+0x56/0x310 kernel/workqueue.c:1349 __queue_work+0x96c/0xd20 kernel/workqueue.c:1515 queue_work_on+0x105/0x160 kernel/workqueue.c:1542 queue_work include/linux/workqueue.h:513 [inline] schedule_work include/linux/workqueue.h:574 [inline] destroy_super_rcu+0xd1/0xe0 fs/super.c:172 rcu_do_batch+0x597/0xc40 kernel/rcu/tree.c:2493 rcu_core+0x5ad/0xe40 kernel/rcu/tree.c:2734 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2747 __do_softirq+0x268/0x5bb kernel/softirq.c:309 The buggy address belongs to the object at ffff88811fa74000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 112 bytes inside of 2048-byte region [ffff88811fa74000, ffff88811fa74800) The buggy address belongs to the page: page:ffffea00047e9c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11fa70 head:ffffea00047e9c00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 0000000000000000 0000000300000001 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 4556, ts 272042395590, free_ts 258916786924 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 kmemdup+0x24/0x50 mm/util.c:131 neigh_sysctl_register+0xb0/0x530 net/core/neighbour.c:3635 devinet_sysctl_register+0xaa/0x1e0 net/ipv4/devinet.c:2609 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:10059 __ip_tunnel_create+0x2b0/0x370 net/ipv4/ip_tunnel.c:267 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_compound_page+0x73/0x90 mm/page_alloc.c:710 destroy_compound_page include/linux/mm.h:959 [inline] __put_compound_page+0x73/0xb0 mm/swap.c:117 __put_page+0xc0/0xe0 mm/swap.c:133 put_page include/linux/mm.h:1257 [inline] __skb_frag_unref include/linux/skbuff.h:3085 [inline] skb_release_data+0x240/0x6f0 net/core/skbuff.c:619 skb_release_all net/core/skbuff.c:679 [inline] __kfree_skb+0x50/0x70 net/core/skbuff.c:693 sk_wmem_free_skb+0x12a/0x690 include/net/sock.h:1589 tcp_write_queue_purge+0x145/0x430 net/ipv4/tcp.c:2728 tcp_v4_destroy_sock+0x10b/0x390 net/ipv4/tcp_ipv4.c:2232 inet_csk_destroy_sock+0x160/0x370 net/ipv4/inet_connection_sock.c:891 __tcp_close+0xb7a/0xfd0 net/ipv4/tcp.c:2677 tcp_close+0x29/0xa0 net/ipv4/tcp.c:2689 inet_release+0x184/0x200 net/ipv4/af_inet.c:431 __sock_release net/socket.c:597 [inline] sock_close+0xdf/0x270 net/socket.c:1267 __fput+0x309/0x760 fs/file_table.c:281 ____fput+0x15/0x20 fs/file_table.c:314 Memory state around the buggy address: ffff88811fa73f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88811fa73f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88811fa74000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88811fa74080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88811fa74100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================