================================================================== 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 ffff88815ee12070 by task kworker/u4:0/7 CPU: 1 PID: 7 Comm: kworker/u4:0 Not tainted 5.10.178-syzkaller-00127-g43c801dc3325 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/16/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:1792 [inline] wb_writeback+0x49d/0xc60 fs/fs-writeback.c:1907 wb_check_old_data_flush fs/fs-writeback.c:2009 [inline] wb_do_writeback fs/fs-writeback.c:2062 [inline] wb_workfn+0xb3d/0x1110 fs/fs-writeback.c:2091 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 :299 Allocated by task 16753: 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] kmem_cache_alloc_trace+0x18a/0x2e0 mm/slub.c:2974 kmalloc include/linux/slab.h:552 [inline] f2fs_kmalloc fs/f2fs/f2fs.h:3348 [inline] f2fs_kzalloc fs/f2fs/f2fs.h:3354 [inline] build_curseg fs/f2fs/segment.c:4523 [inline] f2fs_build_segment_manager+0x19b8/0x49d0 fs/f2fs/segment.c:5321 f2fs_fill_super+0x60c5/0x7e30 fs/f2fs/super.c:4279 mount_bdev+0x261/0x370 fs/super.c:1420 f2fs_mount+0x34/0x40 fs/f2fs/super.c:4559 legacy_get_tree+0xf1/0x190 fs/fs_context.c:592 vfs_get_tree+0x88/0x290 fs/super.c:1550 do_new_mount+0x28b/0xac0 fs/namespace.c:2899 path_mount+0x56f/0xcb0 fs/namespace.c:3229 do_mount fs/namespace.c:3242 [inline] __do_sys_mount fs/namespace.c:3450 [inline] __se_sys_mount+0x2c4/0x3b0 fs/namespace.c:3427 __x64_sys_mount+0xbf/0xd0 fs/namespace.c:3427 do_syscall_64+0x34/0x70 entry_SYSCALL_64_after_hwframe+0x61/0xc6 Freed by task 433: 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] kfree+0xc3/0x270 mm/slub.c:4191 destroy_curseg fs/f2fs/segment.c:5396 [inline] f2fs_destroy_segment_manager+0xad3/0xed0 fs/f2fs/segment.c:5444 f2fs_put_super+0x6cd/0xc10 fs/f2fs/super.c:1628 generic_shutdown_super+0x14f/0x2d0 fs/super.c:465 kill_block_super+0x7e/0xe0 fs/super.c:1447 kill_f2fs_super+0x2f9/0x3c0 fs/f2fs/super.c:4591 deactivate_locked_super+0xad/0x110 fs/super.c:335 deactivate_super+0xbe/0xf0 fs/super.c:366 cleanup_mnt+0x45c/0x510 fs/namespace.c:1118 __cleanup_mnt+0x19/0x20 fs/namespace.c:1125 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xbf/0xd0 kernel/entry/common.c:172 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xbc/0x1d0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xc6 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:2492 rcu_core+0x5ad/0xe40 kernel/rcu/tree.c:2733 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2746 __do_softirq+0x268/0x5bb kernel/softirq.c:309 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 __call_rcu kernel/rcu/tree.c:2974 [inline] call_rcu+0x135/0x11f0 kernel/rcu/tree.c:3048 __put_super+0x25c/0x2b0 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:1118 __cleanup_mnt+0x19/0x20 fs/namespace.c:1125 task_work_run+0x129/0x190 kernel/task_work.c:164 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop+0xbf/0xd0 kernel/entry/common.c:172 exit_to_user_mode_prepare kernel/entry/common.c:199 [inline] syscall_exit_to_user_mode+0xbc/0x1d0 kernel/entry/common.c:274 do_syscall_64+0x40/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x61/0xc6 The buggy address belongs to the object at ffff88815ee12000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 112 bytes inside of 2048-byte region [ffff88815ee12000, ffff88815ee12800) The buggy address belongs to the page: page:ffffea00057b8400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x15ee10 head:ffffea00057b8400 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head) raw: 4000000000010200 ffffea0005770000 0000000300000003 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 0xd2a20(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 440, ts 155695659668, free_ts 0 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2455 [inline] prep_new_page+0x166/0x180 mm/page_alloc.c:2461 get_page_from_freelist+0x2d8c/0x2f30 mm/page_alloc.c:4253 __alloc_pages_nodemask+0x435/0xaf0 mm/page_alloc.c:5345 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 __kmalloc_reserve net/core/skbuff.c:143 [inline] __alloc_skb+0xbc/0x510 net/core/skbuff.c:211 alloc_skb include/linux/skbuff.h:1125 [inline] nlmsg_new include/net/netlink.h:953 [inline] inet6_ifinfo_notify+0x70/0x110 net/ipv6/addrconf.c:6010 addrconf_notify+0xa48/0xe90 net/ipv6/addrconf.c:3664 notifier_call_chain kernel/notifier.c:83 [inline] raw_notifier_call_chain+0x8c/0xf0 kernel/notifier.c:410 __dev_notify_flags+0x304/0x610 dev_change_flags+0xf0/0x1a0 net/core/dev.c:8578 do_setlink+0xc5c/0x3c10 net/core/rtnetlink.c:2709 __rtnl_newlink net/core/rtnetlink.c:3379 [inline] rtnl_newlink+0x1588/0x1f10 net/core/rtnetlink.c:3494 rtnetlink_rcv_msg+0x955/0xc50 net/core/rtnetlink.c:5571 page_owner free stack trace missing Memory state around the buggy address: ffff88815ee11f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88815ee11f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88815ee12000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88815ee12080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88815ee12100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================