================================================================== 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 ffff8881a621c070 by task kworker/u4:5/10408 CPU: 0 PID: 10408 Comm: kworker/u4:5 Not tainted 5.4.233-syzkaller-00001-g0fcb7cff9462 #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_background_flush fs/fs-writeback.c:1975 [inline] wb_do_writeback fs/fs-writeback.c:2063 [inline] wb_workfn+0xce8/0x1230 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 32676: save_stack mm/kasan/common.c:70 [inline] set_track mm/kasan/common.c:78 [inline] __kasan_kmalloc+0x171/0x210 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/0xe10 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 6355: 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+0x1b5/0x270 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+0x123/0x370 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 ffff8881a621c000 which belongs to the cache kmalloc-2k of size 2048 The buggy address is located 112 bytes inside of 2048-byte region [ffff8881a621c000, ffff8881a621c800) The buggy address belongs to the page: page:ffffea0006988600 refcount:1 mapcount:0 mapping:ffff8881f5c0c000 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 0000000000000000 0000000200000001 ffff8881f5c0c000 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 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC) 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+0x2d13/0x2d90 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+0x62/0xa0 mm/slub.c:2707 slab_alloc_node mm/slub.c:2792 [inline] slab_alloc mm/slub.c:2837 [inline] __kmalloc+0x19b/0x2e0 mm/slub.c:3909 kmalloc include/linux/slab.h:561 [inline] kzalloc include/linux/slab.h:690 [inline] __register_sysctl_table+0xdb/0x11d0 fs/proc/proc_sysctl.c:1332 __addrconf_sysctl_register+0x28f/0x3e0 net/ipv6/addrconf.c:6945 addrconf_sysctl_register+0x128/0x180 net/ipv6/addrconf.c:6992 ipv6_add_dev+0xb34/0x10a0 net/ipv6/addrconf.c:445 addrconf_notify+0x59b/0xe50 net/ipv6/addrconf.c:3534 notifier_call_chain kernel/notifier.c:98 [inline] __raw_notifier_call_chain kernel/notifier.c:399 [inline] raw_notifier_call_chain+0x95/0x110 kernel/notifier.c:406 call_netdevice_notifiers_info net/core/dev.c:1670 [inline] call_netdevice_notifiers_extack net/core/dev.c:1682 [inline] call_netdevice_notifiers net/core/dev.c:1696 [inline] register_netdevice+0xeef/0x12a0 net/core/dev.c:9207 xfrmi_create net/xfrm/xfrm_interface.c:144 [inline] xfrmi_newlink+0x320/0x420 net/xfrm/xfrm_interface.c:684 page_owner free stack trace missing Memory state around the buggy address: ffff8881a621bf00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881a621bf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff8881a621c000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881a621c080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881a621c100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== attempt to access beyond end of device loop2: rw=2049, want=40992, limit=40427