================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:101 [inline] BUG: KASAN: use-after-free in atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [inline] BUG: KASAN: use-after-free in __refcount_add include/linux/refcount.h:193 [inline] BUG: KASAN: use-after-free in __refcount_inc include/linux/refcount.h:250 [inline] BUG: KASAN: use-after-free in refcount_inc include/linux/refcount.h:267 [inline] BUG: KASAN: use-after-free in get_task_struct include/linux/sched/task.h:104 [inline] BUG: KASAN: use-after-free in kthread_stop+0x36/0x3d0 kernel/kthread.c:638 Write of size 4 at addr ffff88810e6fe2e0 by task syz-executor040/369 CPU: 1 PID: 369 Comm: syz-executor040 Not tainted 5.10.75-syzkaller-01082-g234d53d2bb60 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack_lvl+0x1e2/0x24b lib/dump_stack.c:118 print_address_description+0x8d/0x3d0 mm/kasan/report.c:233 __kasan_report+0x142/0x220 mm/kasan/report.c:419 kasan_report+0x51/0x70 mm/kasan/report.c:436 check_region_inline mm/kasan/generic.c:135 [inline] kasan_check_range+0x2b6/0x2f0 mm/kasan/generic.c:186 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:101 [inline] atomic_fetch_add_relaxed include/asm-generic/atomic-instrumented.h:142 [inline] __refcount_add include/linux/refcount.h:193 [inline] __refcount_inc include/linux/refcount.h:250 [inline] refcount_inc include/linux/refcount.h:267 [inline] get_task_struct include/linux/sched/task.h:104 [inline] kthread_stop+0x36/0x3d0 kernel/kthread.c:638 ext4_stop_mmpd+0x47/0xb0 fs/ext4/mmp.c:254 ext4_put_super+0xa09/0xe90 fs/ext4/super.c:1263 generic_shutdown_super+0x13f/0x2c0 fs/super.c:464 kill_block_super+0x80/0xe0 fs/super.c:1446 deactivate_locked_super+0xb0/0x100 fs/super.c:335 deactivate_super+0xa5/0xd0 fs/super.c:366 cleanup_mnt+0x45f/0x510 fs/namespace.c:1118 __cleanup_mnt+0x19/0x20 fs/namespace.c:1125 task_work_run+0x147/0x1b0 kernel/task_work.c:154 tracehook_notify_resume include/linux/tracehook.h:188 [inline] exit_to_user_mode_loop kernel/entry/common.c:164 [inline] exit_to_user_mode_prepare+0xc3/0xe0 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x24/0x40 kernel/entry/common.c:266 do_syscall_64+0x3d/0x70 arch/x86/entry/common.c:56 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x7ff98ad3a537 Code: 07 00 48 83 c4 08 5b 5d c3 66 2e 0f 1f 84 00 00 00 00 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffd285963e8 EFLAGS: 00000206 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 000000000000d323 RCX: 00007ff98ad3a537 RDX: 00007ffd285964a9 RSI: 0000000000000002 RDI: 00007ffd285964a0 RBP: 00007ffd285964a0 R08: 00000000ffffffff R09: 00007ffd28596280 R10: 00005555556dc633 R11: 0000000000000206 R12: 00007ffd28597510 R13: 00005555556dc5f0 R14: 00007ffd28596410 R15: 0000000000000009 Allocated by task 2: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:428 [inline] __kasan_slab_alloc+0xb2/0xe0 mm/kasan/common.c:461 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook mm/slab.h:583 [inline] slab_alloc_node mm/slub.c:2941 [inline] slab_alloc mm/slub.c:2949 [inline] kmem_cache_alloc+0x1a2/0x380 mm/slub.c:2954 kmem_cache_alloc_node include/linux/slab.h:423 [inline] alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct+0xbc/0xea0 kernel/fork.c:895 copy_process+0x665/0x5330 kernel/fork.c:1987 kernel_clone+0x21f/0x9a0 kernel/fork.c:2507 kernel_thread+0x16c/0x1e0 kernel/fork.c:2561 create_kthread kernel/kthread.c:336 [inline] kthreadd+0x3cd/0x510 kernel/kthread.c:680 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 Freed by task 0: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:357 ____kasan_slab_free+0x133/0x170 mm/kasan/common.c:360 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:368 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1596 [inline] slab_free_freelist_hook+0xb2/0x180 mm/slub.c:1621 slab_free mm/slub.c:3195 [inline] kmem_cache_free+0xaa/0x1e0 mm/slub.c:3211 free_task_struct kernel/fork.c:181 [inline] free_task+0xb9/0x1e0 kernel/fork.c:473 __put_task_struct+0x2e0/0x440 kernel/fork.c:776 put_task_struct include/linux/sched/task.h:113 [inline] delayed_put_task_struct+0x67/0x190 kernel/exit.c:174 rcu_do_batch+0x4cd/0xb40 kernel/rcu/tree.c:2484 rcu_core+0x822/0x10d0 kernel/rcu/tree.c:2721 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2734 __do_softirq+0x27e/0x598 kernel/softirq.c:305 Last potentially related work creation: kasan_save_stack+0x36/0x60 mm/kasan/common.c:38 kasan_record_aux_stack+0xd3/0xf0 mm/kasan/generic.c:345 __call_rcu kernel/rcu/tree.c:2962 [inline] call_rcu+0x134/0x1470 kernel/rcu/tree.c:3036 put_task_struct_rcu_user+0x58/0xa0 kernel/exit.c:180 finish_task_switch+0x251/0x5f0 kernel/sched/core.c:3888 context_switch kernel/sched/core.c:4018 [inline] __schedule+0x94c/0xda0 kernel/sched/core.c:4776 schedule_idle+0x60/0x90 kernel/sched/core.c:4882 do_idle+0x584/0x5e0 kernel/sched/idle.c:330 cpu_startup_entry+0x25/0x30 kernel/sched/idle.c:398 start_secondary+0xd7/0xe0 arch/x86/kernel/smpboot.c:265 secondary_startup_64_no_verify+0xb0/0xbb The buggy address belongs to the object at ffff88810e6fe2c0 which belongs to the cache task_struct of size 4800 The buggy address is located 32 bytes inside of 4800-byte region [ffff88810e6fe2c0, ffff88810e6ff580) The buggy address belongs to the page: page:ffffea000439be00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x10e6f8 head:ffffea000439be00 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff888100067680 raw: 0000000000000000 0000000000060006 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), pid 2, ts 54095727322, free_ts 53963999791 set_page_owner include/linux/page_owner.h:35 [inline] post_alloc_hook mm/page_alloc.c:2385 [inline] prep_new_page mm/page_alloc.c:2391 [inline] get_page_from_freelist+0xa74/0xa90 mm/page_alloc.c:4063 __alloc_pages_nodemask+0x3c8/0x820 mm/page_alloc.c:5106 alloc_slab_page mm/slub.c:1800 [inline] allocate_slab+0x6b/0x350 mm/slub.c:1802 new_slab mm/slub.c:1863 [inline] new_slab_objects mm/slub.c:2622 [inline] ___slab_alloc+0x143/0x2f0 mm/slub.c:2785 __slab_alloc mm/slub.c:2825 [inline] slab_alloc_node mm/slub.c:2907 [inline] slab_alloc mm/slub.c:2949 [inline] kmem_cache_alloc+0x26f/0x380 mm/slub.c:2954 kmem_cache_alloc_node include/linux/slab.h:423 [inline] alloc_task_struct_node kernel/fork.c:176 [inline] dup_task_struct+0xbc/0xea0 kernel/fork.c:895 copy_process+0x665/0x5330 kernel/fork.c:1987 kernel_clone+0x21f/0x9a0 kernel/fork.c:2507 kernel_thread+0x16c/0x1e0 kernel/fork.c:2561 create_kthread kernel/kthread.c:336 [inline] kthreadd+0x3cd/0x510 kernel/kthread.c:680 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:296 page last free stack trace: reset_page_owner include/linux/page_owner.h:28 [inline] free_pages_prepare mm/page_alloc.c:1331 [inline] __free_pages_ok+0xbe7/0xc20 mm/page_alloc.c:1611 free_the_page mm/page_alloc.c:5167 [inline] __free_pages+0x2d6/0x4a0 mm/page_alloc.c:5173 __free_slab+0xdf/0x1a0 mm/slub.c:1888 free_slab mm/slub.c:1903 [inline] discard_slab mm/slub.c:1909 [inline] unfreeze_partials+0x17d/0x1b0 mm/slub.c:2403 put_cpu_partial+0xc8/0x190 mm/slub.c:2439 __slab_free+0x2eb/0x4e0 mm/slub.c:3089 do_slab_free mm/slub.c:3183 [inline] ___cache_free+0x131/0x150 mm/slub.c:3202 qlink_free+0x38/0x40 mm/kasan/quarantine.c:146 qlist_free_all mm/kasan/quarantine.c:165 [inline] kasan_quarantine_reduce+0x178/0x1d0 mm/kasan/quarantine.c:272 __kasan_slab_alloc+0x2f/0xe0 mm/kasan/common.c:438 kasan_slab_alloc include/linux/kasan.h:259 [inline] slab_post_alloc_hook mm/slab.h:583 [inline] slab_alloc_node mm/slub.c:2941 [inline] slab_alloc mm/slub.c:2949 [inline] kmem_cache_alloc_trace+0x1a5/0x3a0 mm/slub.c:2966 kmalloc include/linux/slab.h:552 [inline] inode_doinit_use_xattr+0x60/0x400 security/selinux/hooks.c:1331 inode_doinit_with_dentry+0x8fc/0x11f0 security/selinux/hooks.c:1460 sb_finish_set_opts+0x4f8/0x7f0 security/selinux/hooks.c:535 selinux_set_mnt_opts+0x16f8/0x23c0 security/selinux/hooks.c:825 security_sb_set_mnt_opts+0x7b/0xe0 security/security.c:902 Memory state around the buggy address: ffff88810e6fe180: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88810e6fe200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88810e6fe280: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff88810e6fe300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88810e6fe380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================