================================================================== BUG: KASAN: use-after-free in instrument_atomic_read include/linux/instrumented.h:71 [inline] BUG: KASAN: use-after-free in atomic_long_read include/linux/atomic/atomic-instrumented.h:1183 [inline] BUG: KASAN: use-after-free in __down_read_trylock kernel/locking/rwsem.c:1331 [inline] BUG: KASAN: use-after-free in down_read_trylock+0x7c/0x300 kernel/locking/rwsem.c:1598 Read of size 8 at addr ffff888110b0e070 by task kworker/u4:0/12401 CPU: 1 PID: 12401 Comm: kworker/u4:0 Not tainted 5.15.149-syzkaller-00131-g79bd336c7a94 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024 Workqueue: writeback wb_workfn (flush-7:2) 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 kasan_check_range+0x293/0x2a0 mm/kasan/generic.c:189 __kasan_check_read+0x11/0x20 mm/kasan/shadow.c:31 instrument_atomic_read include/linux/instrumented.h:71 [inline] atomic_long_read include/linux/atomic/atomic-instrumented.h:1183 [inline] __down_read_trylock kernel/locking/rwsem.c:1331 [inline] down_read_trylock+0x7c/0x300 kernel/locking/rwsem.c:1598 trylock_super+0x1f/0xf0 fs/super.c:418 __writeback_inodes_wb+0x101/0x3f0 fs/fs-writeback.c:1992 wb_writeback+0x3cd/0x9e0 fs/fs-writeback.c:2106 wb_check_old_data_flush fs/fs-writeback.c:2206 [inline] wb_do_writeback fs/fs-writeback.c:2259 [inline] wb_workfn+0xb3d/0x1110 fs/fs-writeback.c:2288 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 Allocated by task 15300: 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+0x13a/0x270 mm/slub.c:4427 kmalloc include/linux/slab.h:608 [inline] kzalloc include/linux/slab.h:733 [inline] __register_sysctl_table+0xea/0x1240 fs/proc/proc_sysctl.c:1321 register_net_sysctl+0x21e/0x230 net/sysctl_net.c:169 __devinet_sysctl_register+0x1d3/0x2a0 net/ipv4/devinet.c:2578 devinet_sysctl_register+0x16a/0x1e0 net/ipv4/devinet.c:2618 inetdev_init+0x284/0x4b0 net/ipv4/devinet.c:283 inetdev_event+0x205/0x10a0 net/ipv4/devinet.c:1531 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:2025 [inline] call_netdevice_notifiers_extack net/core/dev.c:2037 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2051 register_netdevice+0x1035/0x1390 net/core/dev.c:10392 __ip_tunnel_create+0x2b0/0x370 net/ipv4/ip_tunnel.c:267 ip_tunnel_init_net+0x28d/0x750 net/ipv4/ip_tunnel.c:1070 ipip_init_net+0x29/0x30 net/ipv4/ipip.c:647 ops_init+0x1cf/0x4a0 net/core/net_namespace.c:135 setup_net+0x34b/0xb50 net/core/net_namespace.c:329 copy_net_ns+0x35c/0x5b0 net/core/net_namespace.c:473 create_new_namespaces+0x416/0x670 kernel/nsproxy.c:110 unshare_nsproxy_namespaces+0x126/0x180 kernel/nsproxy.c:226 ksys_unshare+0x542/0xa00 kernel/fork.c:3168 __do_sys_unshare kernel/fork.c:3242 [inline] __se_sys_unshare kernel/fork.c:3240 [inline] __x64_sys_unshare+0x38/0x40 kernel/fork.c:3240 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 Freed by task 334: 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] kmem_cache_free_bulk+0x552/0x700 mm/slub.c:3660 kfree_bulk include/linux/slab.h:460 [inline] kfree_rcu_work+0x2b2/0x6a0 kernel/rcu/tree.c:3330 process_one_work+0x6bb/0xc10 kernel/workqueue.c:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:298 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+0xb1/0x8b0 kernel/rcu/tree.c:3644 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 __devinet_sysctl_unregister net/ipv4/devinet.c:2601 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2629 [inline] inetdev_destroy net/ipv4/devinet.c:325 [inline] inetdev_event+0x774/0x10a0 net/ipv4/devinet.c:1599 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:2025 [inline] call_netdevice_notifiers_extack net/core/dev.c:2037 [inline] call_netdevice_notifiers net/core/dev.c:2051 [inline] unregister_netdevice_many+0xe0a/0x17c0 net/core/dev.c:11105 ip_tunnel_delete_nets+0x33b/0x380 net/ipv4/ip_tunnel.c:1123 ipip_exit_batch_net+0x22/0x30 net/ipv4/ipip.c:652 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:2325 worker_thread+0xad5/0x12a0 kernel/workqueue.c:2472 kthread+0x421/0x510 kernel/kthread.c:337 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:1373 __queue_work+0x92a/0xcd0 kernel/workqueue.c:1539 queue_work_on+0x105/0x170 kernel/workqueue.c:1566 queue_work include/linux/workqueue.h:510 [inline] schedule_work include/linux/workqueue.h:571 [inline] destroy_super_rcu+0xd1/0xe0 fs/super.c:172 rcu_do_batch+0x57a/0xc10 kernel/rcu/tree.c:2523 rcu_core+0x517/0x1020 kernel/rcu/tree.c:2763 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2776 __do_softirq+0x26d/0x5bf kernel/softirq.c:565 The buggy address belongs to the object at ffff888110b0e000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 112 bytes inside of 2048-byte region [ffff888110b0e000, ffff888110b0e800) The buggy address belongs to the page: page:ffffea000442c200 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x110b08 head:ffffea000442c200 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 ffffea00044f7200 0000000300000003 ffff888100043200 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 11931, ts 714458194519, free_ts 712676689981 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2604 prep_new_page+0x1b/0x110 mm/page_alloc.c:2610 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4484 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5776 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+0x16d/0x270 mm/slub.c:4423 kmalloc include/linux/slab.h:608 [inline] kzalloc include/linux/slab.h:733 [inline] __register_sysctl_table+0xea/0x1240 fs/proc/proc_sysctl.c:1321 register_net_sysctl+0x21e/0x230 net/sysctl_net.c:169 __addrconf_sysctl_register+0x28f/0x3e0 net/ipv6/addrconf.c:7120 addrconf_sysctl_register+0x141/0x1a0 net/ipv6/addrconf.c:7167 ipv6_add_dev+0xc84/0x1140 net/ipv6/addrconf.c:454 addrconf_notify+0x593/0xdd0 net/ipv6/addrconf.c:3582 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:2025 [inline] call_netdevice_notifiers_extack net/core/dev.c:2037 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2051 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1471 [inline] free_pcp_prepare mm/page_alloc.c:1543 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3533 free_unref_page+0xe8/0x750 mm/page_alloc.c:3615 free_the_page mm/page_alloc.c:804 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5852 __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 getname_flags+0xba/0x520 fs/namei.c:138 user_path_at_empty+0x2d/0x1a0 fs/namei.c:2882 Memory state around the buggy address: ffff888110b0df00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888110b0df80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888110b0e000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888110b0e080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888110b0e100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================