[ 23.800887] BUG: Bad rss-counter state mm:000000009b18c413 type:MM_FILEPAGES val:33 [ 23.803072] BUG: Bad rss-counter state mm:000000009b18c413 type:MM_ANONPAGES val:22 [ 23.949150] ================================================================== [ 23.950216] BUG: KASAN: slab-use-after-free in vma_interval_tree_remove+0xc75/0xec0 [ 23.951265] Read of size 8 at addr ffff88800e06e798 by task sshd/219 [ 23.952089] [ 23.952309] CPU: 0 PID: 219 Comm: sshd Not tainted 6.4.0-rc7-next-20230620 #1 [ 23.953189] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 [ 23.954174] Call Trace: [ 23.954493] [ 23.954784] dump_stack_lvl+0x91/0xf0 [ 23.955269] print_report+0xcc/0x620 [ 23.955747] ? __virt_addr_valid+0x102/0x340 [ 23.956300] ? vma_interval_tree_remove+0xc75/0xec0 [ 23.956911] ? vma_interval_tree_remove+0xc75/0xec0 [ 23.957530] kasan_report+0xbe/0xf0 [ 23.958011] ? vma_interval_tree_remove+0xc75/0xec0 [ 23.958633] vma_interval_tree_remove+0xc75/0xec0 [ 23.959235] vma_prepare+0xc54/0x11a0 [ 23.959716] __split_vma+0x5af/0x950 [ 23.960191] ? __pfx___split_vma+0x10/0x10 [ 23.960718] ? find_held_lock+0x2c/0x110 [ 23.961246] do_vmi_align_munmap+0x2ba/0x11f0 [ 23.961813] ? lock_is_held_type+0x9f/0x120 [ 23.962354] ? __pfx_do_vmi_align_munmap+0x10/0x10 [ 23.962981] ? mtree_range_walk+0x632/0x900 [ 23.963532] ? mas_walk+0x5c7/0x7c0 [ 23.964009] do_vmi_munmap+0x1f1/0x2b0 [ 23.964503] mmap_region+0x1f9/0x2660 [ 23.964988] ? vm_mmap_pgoff+0x15c/0x3a0 [ 23.965503] ? __pfx_arch_get_unmapped_area_topdown+0x10/0x10 [ 23.966219] ? __pfx_lock_acquire+0x10/0x10 [ 23.966761] ? __pfx_mmap_region+0x10/0x10 [ 23.967293] ? security_mmap_addr+0x7d/0xa0 [ 23.967825] ? get_unmapped_area+0x1f5/0x3f0 [ 23.968377] do_mmap+0x854/0xf00 [ 23.968815] vm_mmap_pgoff+0x1a6/0x3a0 [ 23.969312] ? __pfx_vm_mmap_pgoff+0x10/0x10 [ 23.969878] ksys_mmap_pgoff+0x3af/0x500 [ 23.970382] do_syscall_64+0x3f/0x90 [ 23.970879] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 23.971530] RIP: 0033:0x7f2578ce2d82 [ 23.971983] Code: eb aa 66 0f 1f 44 00 00 41 f7 c1 ff 0f 00 00 75 27 55 48 89 fd 53 89 cb 48 85 ff 74 33 41 89 da 48 89 ef b8 09 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 56 5b 5d c3 0f 1f 00 c7 05 ae 03 01 00 16 00 [ 23.974116] RSP: 002b:00007ffe583bd308 EFLAGS: 00000206 ORIG_RAX: 0000000000000009 [ 23.975045] RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007f2578ce2d82 [ 23.975897] RDX: 0000000000000005 RSI: 0000000000001000 RDI: 00007f257811c000 [ 23.976755] RBP: 00007f257811c000 R08: 0000000000000009 R09: 0000000000001000 [ 23.977609] R10: 0000000000000812 R11: 0000000000000206 R12: 00005618e31d3ec0 [ 23.978465] R13: 00007ffe583bd320 R14: 00007ffe583bd350 R15: 00007ffe583bd6b0 [ 23.979342] [ 23.979642] [ 23.979862] Allocated by task 212: [ 23.980295] kasan_save_stack+0x22/0x50 [ 23.980803] kasan_set_track+0x25/0x30 [ 23.981306] __kasan_slab_alloc+0x59/0x70 [ 23.981832] kmem_cache_alloc+0x16b/0x370 [ 23.982356] vm_area_dup+0x20/0x160 [ 23.982819] __split_vma+0x170/0x950 [ 23.983281] split_vma+0xc6/0x110 [ 23.983720] mprotect_fixup+0x8d2/0xb30 [ 23.984224] do_mprotect_pkey+0x87e/0xd40 [ 23.984748] __x64_sys_mprotect+0x78/0xc0 [ 23.985269] do_syscall_64+0x3f/0x90 [ 23.985743] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 23.986388] [ 23.986624] Freed by task 212: [ 23.987020] kasan_save_stack+0x22/0x50 [ 23.987531] kasan_set_track+0x25/0x30 [ 23.988029] kasan_save_free_info+0x2b/0x50 [ 23.988566] __kasan_slab_free+0x10a/0x190 [ 23.989097] kmem_cache_free+0x10d/0x4d0 [ 23.989601] rcu_core+0x8c8/0x2860 [ 23.990047] __do_softirq+0x1b7/0x7d4 [ 23.990525] [ 23.990748] Last potentially related work creation: [ 23.991335] kasan_save_stack+0x22/0x50 [ 23.991844] __kasan_record_aux_stack+0x8e/0xa0 [ 23.992420] __call_rcu_common.constprop.0+0x6a/0xb90 [ 23.993072] remove_vma+0x139/0x170 [ 23.993529] do_vmi_align_munmap+0xd4a/0x11f0 [ 23.994091] do_vmi_munmap+0x1f1/0x2b0 [ 23.994590] __vm_munmap+0x138/0x3a0 [ 23.995068] __x64_sys_munmap+0x59/0x80 [ 23.995565] do_syscall_64+0x3f/0x90 [ 23.996043] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 23.996681] [ 23.996898] Second to last potentially related work creation: [ 23.997578] kasan_save_stack+0x22/0x50 [ 23.998080] __kasan_record_aux_stack+0x8e/0xa0 [ 23.998673] __call_rcu_common.constprop.0+0x6a/0xb90 [ 23.999313] remove_vma+0x139/0x170 [ 23.999770] do_vmi_align_munmap+0xd4a/0x11f0 [ 24.000326] do_vmi_munmap+0x1f1/0x2b0 [ 24.000810] mmap_region+0x1f9/0x2660 [ 24.001290] do_mmap+0x854/0xf00 [ 24.001721] vm_mmap_pgoff+0x1a6/0x3a0 [ 24.002207] ksys_mmap_pgoff+0x3af/0x500 [ 24.002718] do_syscall_64+0x3f/0x90 [ 24.003195] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 24.003843] [ 24.004066] The buggy address belongs to the object at ffff88800e06e740 [ 24.004066] which belongs to the cache vm_area_struct of size 168 [ 24.005539] The buggy address is located 88 bytes inside of [ 24.005539] freed 168-byte region [ffff88800e06e740, ffff88800e06e7e8) [ 24.006952] [ 24.007167] The buggy address belongs to the physical page: [ 24.007823] page:000000002536b2ca refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xe06e [ 24.008909] memcg:ffff88800eb75901 [ 24.009338] anon flags: 0x100000000000200(slab|node=0|zone=1) [ 24.010040] page_type: 0xffffffff() [ 24.010492] raw: 0100000000000200 ffff8880087a0c80 ffffea000036cf80 dead000000000007 [ 24.011419] raw: 0000000000000000 0000000000110011 00000001ffffffff ffff88800eb75901 [ 24.012320] page dumped because: kasan: bad access detected [ 24.012984] [ 24.013197] Memory state around the buggy address: [ 24.013780] ffff88800e06e680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 24.014657] ffff88800e06e700: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb [ 24.015517] >ffff88800e06e780: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc [ 24.016370] ^ [ 24.016884] ffff88800e06e800: fc fc fc fc fc 00 00 00 00 00 00 00 00 00 00 00 [ 24.017748] ffff88800e06e880: 00 00 00 00 00 00 00 00 00 00 fc fc fc fc fc fc [ 24.018629] ================================================================== [ 24.019594] Disabling lock debugging due to kernel taint Debian GNU/Linux 11 syzkaller ttyS0 syzkaller login: [ 26.604489] BUG: Bad rss-counter state mm:000000003fedcd7d type:MM_FILEPAGES val:33 [ 26.605511] BUG: Bad rss-counter state mm:000000003fedcd7d type:MM_ANONPAGES val:22 [ 26.985115] BUG: Bad rss-counter state mm:000000001f8a6c66 type:MM_FILEPAGES val:33 [ 26.986095] BUG: Bad rss-counter state mm:000000001f8a6c66 type:MM_ANONPAGES val:22 Warning: Permanently added '[localhost]:51409' (ECDSA) to the list of known hosts. 2023/06/20 11:28:31 fuzzer started 2023/06/20 11:28:31 dialing manager at localhost:36067 2023/06/20 11:28:31 checking machine... 2023/06/20 11:28:31 checking revisions... [ 27.608128] kmemleak: Automatic memory scanning thread ended 2023/06/20 11:28:32 testing simple program... [ 27.660126] cgroup: Unknown subsys name 'net' [ 27.698499] cgroup: Unknown subsys name 'rlimit' executing program executing program executing program VM DIAGNOSIS: 11:28:31 Registers: info registers vcpu 0 RAX=0000000000000070 RBX=ffff88801bfb83c0 RCX=0000000000048cc0 RDX=0000000000048c80 RSI=00000000000000e8 RDI=0000000000048c80 RBP=ffff8880103b7760 RSP=ffff8880103b7710 R8 =0000000000042a50 R9 =0000000000000004 R10=0000000000000000 R11=ffff88801bfb8280 R12=ffff888008e7a500 R13=0000000000000000 R14=00000000000128c0 R15=ffffffff8366a63c RIP=ffffffff81808380 RFL=00000246 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=0 ES =0000 0000000000000000 00000000 00000000 CS =0010 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA] SS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] DS =0000 0000000000000000 00000000 00000000 FS =0000 00007fd912d55900 00000000 00000000 GS =0000 ffff88806ce00000 00000000 00000000 LDT=0000 fffffe0000000000 00000000 00000000 TR =0040 fffffe0000003000 00004087 00008b00 DPL=0 TSS64-busy GDT= fffffe0000001000 0000007f IDT= fffffe0000000000 00000fff CR0=80050033 CR2=00007fd91330c618 CR3=0000000018014000 CR4=00350ef0 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400 EFER=0000000000000d01 FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80 FPR0=0000000000000000 0000 FPR1=0000000000000000 0000 FPR2=0000000000000000 0000 FPR3=0000000000000000 0000 FPR4=0000000000000000 0000 FPR5=0000000000000000 0000 FPR6=0000000000000000 0000 FPR7=0000000000000000 0000 XMM00=00000000000000000000000000000000 XMM01=6e69676f6c5f6d61702c78756e696c65 XMM02=755f6d61702c74696d7265705f6d6170 XMM03=2c766e655f6d61702c7374696d696c5f XMM04=6d61702c766e655f6d61702c7374696d XMM05=78696e755f6d61702c74696d7265705f XMM06=6469756e69676f6c5f6d61702c78756e XMM07=672065736f6c635f6e6f69737365733a XMM08=61662029286e65706f5f746964756100 XMM09=00000000000000000000000000000000 XMM10=00000000000000000000000000000000 XMM11=00000000000000000000000000000000 XMM12=00000000000000000000000000000000 XMM13=00000000000000000000000000000000 XMM14=00000000000000000000000000000000 XMM15=00000000000000000000000000000000 info registers vcpu 1 RAX=ffff88806cf35000 RBX=0000000000000001 RCX=ffffffff8451250e RDX=ffffed100d9e6a01 RSI=0000000000000004 RDI=ffffffff81288ac5 RBP=dffffc0000000000 RSP=ffff888008e07e70 R8 =0000000000000000 R9 =ffffed100d9e6a00 R10=ffff88806cf35003 R11=ffff888008c04400 R12=ffffffff85d3d350 R13=1ffff110011c0fd3 R14=0000000000000000 R15=0000000000000000 RIP=ffffffff8451349f RFL=00000246 [---Z-P-] CPL=0 II=0 A20=1 SMM=0 HLT=1 ES =0000 0000000000000000 00000000 00000000 CS =0010 0000000000000000 ffffffff 00a09b00 DPL=0 CS64 [-RA] SS =0018 0000000000000000 ffffffff 00c09300 DPL=0 DS [-WA] DS =0000 0000000000000000 00000000 00000000 FS =0000 0000000000000000 00000000 00000000 GS =0000 ffff88806cf00000 00000000 00000000 LDT=0000 fffffe0000000000 00000000 00000000 TR =0040 fffffe000004a000 00004087 00008b00 DPL=0 TSS64-busy GDT= fffffe0000048000 0000007f IDT= fffffe0000000000 00000fff CR0=80050033 CR2=00007fdc24739600 CR3=000000000cbc6000 CR4=00350ee0 DR0=0000000000000000 DR1=0000000000000000 DR2=0000000000000000 DR3=0000000000000000 DR6=00000000ffff0ff0 DR7=0000000000000400 EFER=0000000000000d01 FCW=037f FSW=0000 [ST=0] FTW=00 MXCSR=00001f80 FPR0=0000000000000000 0000 FPR1=0000000000000000 0000 FPR2=0000000000000000 0000 FPR3=0000000000000000 0000 FPR4=0000000000000000 0000 FPR5=0000000000000000 0000 FPR6=0000000000000000 0000 FPR7=0000000000000000 0000 XMM00=00000000000000000000000000000000 XMM01=8520fb89eb259ca0fc4281fb2a60d95c XMM02=ec2efd57dc4c00df000000000011d230 XMM03=a642e8ec800f860b000000000011d300 XMM04=fbe8b1b05520d0fc00000000000ae988 XMM05=dfcdbad4f1609c3700000000001320d0 XMM06=806171799158d9670000000000131f58 XMM07=e042d86d42eb936e0000000000121220 XMM08=a642e8ec800f860b000000000011d300 XMM09=00000000000000000000000000000000 XMM10=20200000000020202020202020200000 XMM11=00000000000000000000000000000000 XMM12=00000000000000000000000000000000 XMM13=00000000000000000000000000000000 XMM14=00000000000000000000000000000000 XMM15=00000000000000000000000000000000