================================================================== 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+0x76/0x620 kernel/kthread.c:616 Write of size 4 at addr ffff888037241960 by task syz-executor.7/393 CPU: 1 PID: 393 Comm: syz-executor.7 Not tainted 5.10.49 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x107/0x163 lib/dump_stack.c:118 print_address_description.constprop.0+0x1c/0x210 mm/kasan/report.c:385 __kasan_report mm/kasan/report.c:545 [inline] kasan_report.cold+0x37/0x7c mm/kasan/report.c:562 check_memory_region_inline mm/kasan/generic.c:186 [inline] check_memory_region+0xf9/0x1e0 mm/kasan/generic.c:192 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+0x76/0x620 kernel/kthread.c:616 ext4_put_super+0x920/0xfc0 fs/ext4/super.c:1264 generic_shutdown_super+0x142/0x370 fs/super.c:464 kill_block_super+0x9d/0xf0 fs/super.c:1446 deactivate_locked_super+0x99/0x160 fs/super.c:335 deactivate_super+0xad/0xd0 fs/super.c:366 cleanup_mnt+0x396/0x500 fs/namespace.c:1118 task_work_run+0xe2/0x1a0 kernel/task_work.c:151 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+0x155/0x160 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x38/0x230 kernel/entry/common.c:266 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x467a67 Code: ff d0 48 89 c7 b8 3c 00 00 00 0f 05 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdd3eb3548 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 000000000000043d RCX: 0000000000467a67 RDX: 00007ffdd3eb361b RSI: 0000000000000002 RDI: 00007ffdd3eb3610 RBP: 00007ffdd3eb3610 R08: 00000000ffffffff R09: 00007ffdd3eb33e0 R10: 000000000289db43 R11: 0000000000000246 R12: 00000000004bee70 R13: 00007ffdd3eb46e0 R14: 000000000289db00 R15: 00007ffdd3eb4720 Allocated by task 2: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track mm/kasan/common.c:56 [inline] __kasan_kmalloc.constprop.0+0xc2/0xd0 mm/kasan/common.c:461 slab_post_alloc_hook mm/slab.h:533 [inline] slab_alloc_node mm/slub.c:2889 [inline] kmem_cache_alloc_node+0x14b/0x370 mm/slub.c:2925 alloc_task_struct_node kernel/fork.c:170 [inline] dup_task_struct kernel/fork.c:860 [inline] copy_process+0x4380/0x6640 kernel/fork.c:1947 kernel_clone+0xe7/0xa20 kernel/fork.c:2465 kernel_thread+0xb5/0xf0 kernel/fork.c:2517 create_kthread kernel/kthread.c:315 [inline] kthreadd+0x4bb/0x710 kernel/kthread.c:658 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:296 Freed by task 16: kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_set_track+0x1c/0x30 mm/kasan/common.c:56 kasan_set_free_info+0x1b/0x30 mm/kasan/generic.c:355 __kasan_slab_free+0x110/0x150 mm/kasan/common.c:422 slab_free_hook mm/slub.c:1542 [inline] slab_free_freelist_hook+0x64/0x150 mm/slub.c:1575 slab_free mm/slub.c:3140 [inline] kmem_cache_free+0x97/0x2f0 mm/slub.c:3156 __put_task_struct+0x25a/0x3e0 kernel/fork.c:741 put_task_struct include/linux/sched/task.h:113 [inline] delayed_put_task_struct+0x1a4/0x2b0 kernel/exit.c:173 rcu_do_batch kernel/rcu/tree.c:2484 [inline] rcu_core+0x52d/0x1640 kernel/rcu/tree.c:2719 __do_softirq+0x1b8/0x85f kernel/softirq.c:298 Last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x9e/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2961 [inline] call_rcu+0x8a/0xa20 kernel/rcu/tree.c:3035 put_task_struct_rcu_user+0x7f/0xb0 kernel/exit.c:179 finish_task_switch+0x428/0x5d0 kernel/sched/core.c:3649 context_switch kernel/sched/core.c:3779 [inline] __schedule+0x847/0x1e70 kernel/sched/core.c:4525 schedule+0xcb/0x270 kernel/sched/core.c:4603 exit_to_user_mode_loop kernel/entry/common.c:152 [inline] exit_to_user_mode_prepare+0xdd/0x160 kernel/entry/common.c:191 irqentry_exit_to_user_mode+0x5/0x30 kernel/entry/common.c:279 exc_page_fault+0xca/0x1a0 arch/x86/mm/fault.c:1495 asm_exc_page_fault+0x1e/0x30 arch/x86/include/asm/idtentry.h:580 Second to last call_rcu(): kasan_save_stack+0x1b/0x40 mm/kasan/common.c:48 kasan_record_aux_stack+0x9e/0xb0 mm/kasan/generic.c:346 __call_rcu kernel/rcu/tree.c:2961 [inline] call_rcu+0x8a/0xa20 kernel/rcu/tree.c:3035 put_task_struct_rcu_user+0x7f/0xb0 kernel/exit.c:179 finish_task_switch+0x428/0x5d0 kernel/sched/core.c:3649 context_switch kernel/sched/core.c:3779 [inline] __schedule+0x847/0x1e70 kernel/sched/core.c:4525 schedule+0xcb/0x270 kernel/sched/core.c:4603 worker_thread+0x14f/0x1310 kernel/workqueue.c:2437 kthread+0x38f/0x470 kernel/kthread.c:292 ret_from_fork+0x22/0x30 arch/x86/entry/entry_64.S:296 The buggy address belongs to the object at ffff888037241940 which belongs to the cache task_struct of size 6208 The buggy address is located 32 bytes inside of 6208-byte region [ffff888037241940, ffff888037243180) The buggy address belongs to the page: page:000000001a88db97 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x37240 head:000000001a88db97 order:3 compound_mapcount:0 compound_pincount:0 flags: 0x100000000010200(slab|head) raw: 0100000000010200 0000000000000000 0000000200000001 ffff888007fdc140 raw: 0000000000000000 0000000000050005 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888037241800: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff888037241880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888037241900: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ^ ffff888037241980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888037241a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ================================================================== ------------[ cut here ]------------ refcount_t: addition on 0; use-after-free. WARNING: CPU: 1 PID: 393 at lib/refcount.c:25 refcount_warn_saturate+0x178/0x1f0 lib/refcount.c:25 Modules linked in: CPU: 1 PID: 393 Comm: syz-executor.7 Tainted: G B 5.10.49 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014 RIP: 0010:refcount_warn_saturate+0x178/0x1f0 lib/refcount.c:25 Code: 03 31 ff 89 de e8 f8 68 51 ff 84 db 0f 85 2e ff ff ff e8 bb 6f 51 ff 48 c7 c7 80 33 3b 84 c6 05 10 a2 54 03 01 e8 44 a4 c8 01 <0f> 0b e9 0f ff ff ff e8 9c 6f 51 ff 0f b6 1d fa a1 54 03 31 ff 89 RSP: 0018:ffff888039c1fd58 EFLAGS: 00010282 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000 RDX: ffff888008e01940 RSI: ffffffff81293b93 RDI: ffffed1007383f9d RBP: ffff888037241960 R08: 0000000000000001 R09: ffff88806cf2facf R10: 0000000000000000 R11: 0000000000000001 R12: ffff888037241960 R13: ffff888037241940 R14: 0000000000000000 R15: ffff888047168430 FS: 000000000289c400(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000519470 CR3: 0000000039dd8000 CR4: 0000000000350ee0 Call Trace: __refcount_add include/linux/refcount.h:199 [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+0x4fe/0x620 kernel/kthread.c:616 ext4_put_super+0x920/0xfc0 fs/ext4/super.c:1264 generic_shutdown_super+0x142/0x370 fs/super.c:464 kill_block_super+0x9d/0xf0 fs/super.c:1446 deactivate_locked_super+0x99/0x160 fs/super.c:335 deactivate_super+0xad/0xd0 fs/super.c:366 cleanup_mnt+0x396/0x500 fs/namespace.c:1118 task_work_run+0xe2/0x1a0 kernel/task_work.c:151 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+0x155/0x160 kernel/entry/common.c:191 syscall_exit_to_user_mode+0x38/0x230 kernel/entry/common.c:266 entry_SYSCALL_64_after_hwframe+0x44/0xa9 RIP: 0033:0x467a67 Code: ff d0 48 89 c7 b8 3c 00 00 00 0f 05 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffdd3eb3548 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 000000000000043d RCX: 0000000000467a67 RDX: 00007ffdd3eb361b RSI: 0000000000000002 RDI: 00007ffdd3eb3610 RBP: 00007ffdd3eb3610 R08: 00000000ffffffff R09: 00007ffdd3eb33e0 R10: 000000000289db43 R11: 0000000000000246 R12: 00000000004bee70 R13: 00007ffdd3eb46e0 R14: 000000000289db00 R15: 00007ffdd3eb4720 irq event stamp: 2275556 hardirqs last enabled at (2275555): [] quarantine_put+0x87/0x1a0 mm/kasan/quarantine.c:217 hardirqs last disabled at (2275556): [] __raw_spin_lock_irqsave include/linux/spinlock_api_smp.h:108 [inline] hardirqs last disabled at (2275556): [] _raw_spin_lock_irqsave+0x4b/0x50 kernel/locking/spinlock.c:159 softirqs last enabled at (2275166): [] asm_call_irq_on_stack+0x12/0x20 softirqs last disabled at (2275005): [] asm_call_irq_on_stack+0x12/0x20 ---[ end trace 5626cf95680cc7ee ]--- TCP: request_sock_TCPv6: Possible SYN flooding on port 20000. Sending cookies. Check SNMP counters. serio: Serial port tty22 TCP: request_sock_TCPv6: Possible SYN flooding on port 20000. Sending cookies. Check SNMP counters.