================================================================== BUG: KASAN: use-after-free in atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1503 [inline] BUG: KASAN: use-after-free in atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline] BUG: KASAN: use-after-free in __down_read_trylock kernel/locking/rwsem.c:1408 [inline] BUG: KASAN: use-after-free in down_read_trylock+0xba/0x1d0 kernel/locking/rwsem.c:1568 Write of size 8 at addr ffff8881cd48c070 by task kworker/u4:7/4338 CPU: 0 PID: 4338 Comm: kworker/u4:7 Not tainted 5.4.233-syzkaller-00022-gcf4e000017b8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/14/2023 Workqueue: writeback wb_workfn (flush-7:3) Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x1d8/0x241 lib/dump_stack.c:118 print_address_description+0x8c/0x600 mm/kasan/report.c:384 __kasan_report+0xf3/0x120 mm/kasan/report.c:516 kasan_report+0x30/0x60 mm/kasan/common.c:653 check_memory_region_inline mm/kasan/generic.c:141 [inline] check_memory_region+0x272/0x280 mm/kasan/generic.c:191 atomic64_try_cmpxchg include/asm-generic/atomic-instrumented.h:1503 [inline] atomic_long_try_cmpxchg_acquire include/asm-generic/atomic-long.h:442 [inline] __down_read_trylock kernel/locking/rwsem.c:1408 [inline] down_read_trylock+0xba/0x1d0 kernel/locking/rwsem.c:1568 trylock_super+0x1b/0xf0 fs/super.c:418 __writeback_inodes_wb fs/fs-writeback.c:1792 [inline] wb_writeback+0x499/0xd70 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+0xae2/0x10c0 fs/fs-writeback.c:2091 process_one_work+0x765/0xd20 kernel/workqueue.c:2287 worker_thread+0xaef/0x1470 kernel/workqueue.c:2433 kthread+0x2da/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 Allocated by task 12600: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x130/0x1d0 mm/kasan/common.c:529 kmalloc include/linux/slab.h:556 [inline] kzalloc include/linux/slab.h:690 [inline] alloc_super+0x56/0x760 fs/super.c:203 sget+0x1f1/0x4d0 fs/super.c:613 mount_bdev+0xe4/0x340 fs/super.c:1390 legacy_get_tree+0xdf/0x170 fs/fs_context.c:647 vfs_get_tree+0x85/0x260 fs/super.c:1547 do_new_mount+0x292/0x570 fs/namespace.c:2843 do_mount+0x688/0xdd0 fs/namespace.c:3163 ksys_mount+0xc2/0xf0 fs/namespace.c:3372 __do_sys_mount fs/namespace.c:3386 [inline] __se_sys_mount fs/namespace.c:3383 [inline] __x64_sys_mount+0xb1/0xc0 fs/namespace.c:3383 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Freed by task 323: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] kasan_set_free_info mm/kasan/common.c:345 [inline] __kasan_slab_free+0x178/0x230 mm/kasan/common.c:487 slab_free_hook mm/slub.c:1455 [inline] slab_free_freelist_hook mm/slub.c:1494 [inline] slab_free mm/slub.c:3080 [inline] kfree+0xeb/0x320 mm/slub.c:4071 process_one_work+0x765/0xd20 kernel/workqueue.c:2287 worker_thread+0xaef/0x1470 kernel/workqueue.c:2433 kthread+0x2da/0x360 kernel/kthread.c:288 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:354 The buggy address belongs to the object at ffff8881cd48c000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 112 bytes inside of 2048-byte region [ffff8881cd48c000, ffff8881cd48c800) The buggy address belongs to the page: page:ffffea0007352200 refcount:1 mapcount:0 mapping:ffff8881f5c0c000 index:0xffff8881cd48c000 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 ffffea0007a7e608 ffffea0007828608 ffff8881f5c0c000 raw: ffff8881cd48c000 0000000000080007 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) set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook mm/page_alloc.c:2165 [inline] prep_new_page+0x18f/0x370 mm/page_alloc.c:2171 get_page_from_freelist+0x2ce8/0x2d70 mm/page_alloc.c:3794 __alloc_pages_nodemask+0x393/0x840 mm/page_alloc.c:4891 alloc_slab_page+0x39/0x3c0 mm/slub.c:343 allocate_slab mm/slub.c:1683 [inline] new_slab+0x97/0x440 mm/slub.c:1749 new_slab_objects mm/slub.c:2505 [inline] ___slab_alloc+0x2fe/0x490 mm/slub.c:2667 __slab_alloc+0x5a/0x90 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc+0x196/0x2b0 mm/slub.c:3909 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:690 [inline] ops_init+0x86/0x4a0 net/core/net_namespace.c:128 setup_net+0x214/0x990 net/core/net_namespace.c:345 copy_net_ns+0x30f/0x510 net/core/net_namespace.c:486 create_new_namespaces+0x47a/0x570 kernel/nsproxy.c:103 unshare_nsproxy_namespaces+0x119/0x170 kernel/nsproxy.c:202 ksys_unshare+0x544/0x990 kernel/fork.c:2901 __do_sys_unshare kernel/fork.c:2969 [inline] __se_sys_unshare kernel/fork.c:2967 [inline] __x64_sys_unshare+0x34/0x40 kernel/fork.c:2967 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1176 [inline] free_pcp_prepare mm/page_alloc.c:1233 [inline] free_unref_page_prepare+0x297/0x380 mm/page_alloc.c:3085 free_unref_page mm/page_alloc.c:3134 [inline] free_the_page mm/page_alloc.c:4951 [inline] __free_pages+0xaf/0x140 mm/page_alloc.c:4959 __vunmap+0x75b/0x890 mm/vmalloc.c:2260 kcov_put kernel/kcov.c:396 [inline] kcov_close+0x27/0x50 kernel/kcov.c:495 __fput+0x262/0x680 fs/file_table.c:281 task_work_run+0x140/0x170 kernel/task_work.c:113 exit_task_work include/linux/task_work.h:22 [inline] do_exit+0xcaf/0x2bc0 kernel/exit.c:859 do_group_exit+0x138/0x300 kernel/exit.c:982 __do_sys_exit_group kernel/exit.c:993 [inline] __se_sys_exit_group kernel/exit.c:991 [inline] __x64_sys_exit_group+0x3b/0x40 kernel/exit.c:991 do_syscall_64+0xca/0x1c0 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x5c/0xc1 Memory state around the buggy address: ffff8881cd48bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881cd48bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881cd48c000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881cd48c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881cd48c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================