================================================================== 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:1348 [inline] BUG: KASAN: use-after-free in down_read_trylock+0xb5/0x7d0 kernel/locking/rwsem.c:1624 Read of size 8 at addr ffff88810cc47070 by task kworker/u4:2/45 CPU: 0 PID: 45 Comm: kworker/u4:2 Not tainted 5.15.153-syzkaller-1069977-ge787d6ac4af0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/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:1348 [inline] down_read_trylock+0xb5/0x7d0 kernel/locking/rwsem.c:1624 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_background_flush fs/fs-writeback.c:2172 [inline] wb_do_writeback fs/fs-writeback.c:2260 [inline] wb_workfn+0xc12/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 13363: 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:3267 kmalloc include/linux/slab.h:603 [inline] kzalloc include/linux/slab.h:733 [inline] alloc_super+0x5d/0x7d0 fs/super.c:203 sget+0x1e5/0x4c0 fs/super.c:624 mount_bdev+0xea/0x3b0 fs/super.c:1360 f2fs_mount+0x34/0x40 fs/f2fs/super.c:4625 legacy_get_tree+0xf1/0x190 fs/fs_context.c:611 vfs_get_tree+0x88/0x290 fs/super.c:1517 do_new_mount+0x2ba/0xb30 fs/namespace.c:3005 path_mount+0x671/0x1070 fs/namespace.c:3335 do_mount fs/namespace.c:3348 [inline] __do_sys_mount fs/namespace.c:3556 [inline] __se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3533 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3533 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 313: 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 destroy_super_work+0x40/0x50 fs/super.c:165 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 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 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_common kernel/rcu/tree.c:3007 [inline] call_rcu+0x135/0x1310 kernel/rcu/tree.c:3125 __put_super+0x26d/0x2e0 fs/super.c:299 put_super fs/super.c:313 [inline] deactivate_locked_super+0xe1/0x110 fs/super.c:346 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1143 __cleanup_mnt+0x19/0x20 fs/namespace.c:1150 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0xc4/0xe0 kernel/entry/common.c:175 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:208 __syscall_exit_to_user_mode_work kernel/entry/common.c:290 [inline] syscall_exit_to_user_mode+0x26/0x160 kernel/entry/common.c:301 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x61/0xcb The buggy address belongs to the object at ffff88810cc47000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 112 bytes inside of 2048-byte region [ffff88810cc47000, ffff88810cc47800) The buggy address belongs to the page: page:ffffea0004331000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10cc40 head:ffffea0004331000 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 0000000000000000 0000000100000001 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 368, ts 46667620599, free_ts 46658938512 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1a3/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1b/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x3550/0x35d0 mm/page_alloc.c:4485 __alloc_pages+0x27e/0x8f0 mm/page_alloc.c:5777 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 kmemdup+0x24/0x50 mm/util.c:132 neigh_sysctl_register+0xb0/0x530 net/core/neighbour.c:3647 addrconf_sysctl_register+0xae/0x1a0 net/ipv6/addrconf.c:7179 ipv6_add_dev+0xc84/0x1140 net/ipv6/addrconf.c:454 addrconf_notify+0x593/0xdd0 net/ipv6/addrconf.c:3597 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:10395 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1472 [inline] free_pcp_prepare mm/page_alloc.c:1544 [inline] free_unref_page_prepare+0x7c8/0x7d0 mm/page_alloc.c:3534 free_unref_page+0xe8/0x750 mm/page_alloc.c:3616 free_the_page mm/page_alloc.c:805 [inline] __free_pages+0x61/0xf0 mm/page_alloc.c:5853 __free_slab+0xec/0x1d0 mm/slub.c:2020 free_slab mm/slub.c:2035 [inline] discard_slab+0x29/0x40 mm/slub.c:2041 __slab_free+0x205/0x290 mm/slub.c:3424 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] __kmalloc_track_caller+0x11d/0x260 mm/slub.c:4945 kvasprintf+0xd6/0x180 lib/kasprintf.c:25 kvasprintf_const+0x5e/0x190 lib/kasprintf.c:49 kobject_set_name_vargs+0x61/0x120 lib/kobject.c:297 Memory state around the buggy address: ffff88810cc46f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88810cc46f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88810cc47000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88810cc47080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810cc47100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================