[ 23.941059] BUG: Bad rss-counter state mm:00000000f28c7b00 type:MM_FILEPAGES val:33 [ 23.942312] BUG: Bad rss-counter state mm:00000000f28c7b00 type:MM_ANONPAGES val:22 [ 24.288051] ================================================================== [ 24.288911] BUG: KASAN: slab-use-after-free in vma_interval_tree_remove+0xc75/0xec0 [ 24.289809] Read of size 8 at addr ffff88800ec6c968 by task sshd/219 [ 24.290539] [ 24.290745] CPU: 1 PID: 219 Comm: sshd Not tainted 6.4.0-rc7-next-20230620 #1 [ 24.291748] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 [ 24.292672] Call Trace: [ 24.292980] [ 24.293253] dump_stack_lvl+0x91/0xf0 [ 24.293763] print_report+0xcc/0x620 [ 24.294230] ? __virt_addr_valid+0x102/0x340 [ 24.294749] ? vma_interval_tree_remove+0xc75/0xec0 [ 24.295333] ? vma_interval_tree_remove+0xc75/0xec0 [ 24.295916] kasan_report+0xbe/0xf0 [ 24.296367] ? vma_interval_tree_remove+0xc75/0xec0 [ 24.296954] vma_interval_tree_remove+0xc75/0xec0 [ 24.297530] vma_prepare+0xc54/0x11a0 [ 24.298017] __split_vma+0x5af/0x950 [ 24.298479] ? __pfx___split_vma+0x10/0x10 [ 24.299004] ? find_held_lock+0x2c/0x110 [ 24.299522] do_vmi_align_munmap+0x2ba/0x11f0 [ 24.300082] ? lock_is_held_type+0x9f/0x120 [ 24.300623] ? __pfx_do_vmi_align_munmap+0x10/0x10 [ 24.301232] ? mtree_range_walk+0x632/0x900 [ 24.301787] ? mas_walk+0x5c7/0x7c0 [ 24.302263] do_vmi_munmap+0x1f1/0x2b0 [ 24.302754] mmap_region+0x1f9/0x2660 [ 24.303233] ? vm_mmap_pgoff+0x15c/0x3a0 [ 24.303744] ? __pfx_arch_get_unmapped_area_topdown+0x10/0x10 [ 24.304454] ? __pfx_lock_acquire+0x10/0x10 [ 24.304998] ? __pfx_mmap_region+0x10/0x10 [ 24.305553] ? security_mmap_addr+0x7d/0xa0 [ 24.306083] ? get_unmapped_area+0x1f5/0x3f0 [ 24.306633] do_mmap+0x854/0xf00 [ 24.307074] vm_mmap_pgoff+0x1a6/0x3a0 [ 24.307564] ? __pfx_vm_mmap_pgoff+0x10/0x10 [ 24.308121] ksys_mmap_pgoff+0x3af/0x500 [ 24.308629] do_syscall_64+0x3f/0x90 [ 24.309109] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 24.309770] RIP: 0033:0x7f8eaa9bbd82 [ 24.310229] 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 [ 24.312356] RSP: 002b:00007ffc236baed8 EFLAGS: 00000206 ORIG_RAX: 0000000000000009 [ 24.313260] RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007f8eaa9bbd82 [ 24.314114] RDX: 0000000000000005 RSI: 0000000000001000 RDI: 00007f8ea9df5000 [ 24.314965] RBP: 00007f8ea9df5000 R08: 0000000000000009 R09: 0000000000001000 [ 24.315806] R10: 0000000000000812 R11: 0000000000000206 R12: 000056024c986ec0 [ 24.316651] R13: 00007ffc236baef0 R14: 00007ffc236baf20 R15: 00007ffc236bb280 [ 24.317536] [ 24.317829] [ 24.318045] Allocated by task 207: [ 24.318476] kasan_save_stack+0x22/0x50 [ 24.318981] kasan_set_track+0x25/0x30 [ 24.319480] __kasan_slab_alloc+0x59/0x70 [ 24.320008] kmem_cache_alloc+0x16b/0x370 [ 24.320521] vm_area_dup+0x20/0x160 [ 24.320982] __split_vma+0x170/0x950 [ 24.321446] split_vma+0xc6/0x110 [ 24.321883] mprotect_fixup+0x8d2/0xb30 [ 24.322392] do_mprotect_pkey+0x87e/0xd40 [ 24.322912] __x64_sys_mprotect+0x78/0xc0 [ 24.323430] do_syscall_64+0x3f/0x90 [ 24.323912] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 24.324542] [ 24.324760] Freed by task 13: [ 24.325147] kasan_save_stack+0x22/0x50 [ 24.325656] kasan_set_track+0x25/0x30 [ 24.326155] kasan_save_free_info+0x2b/0x50 [ 24.326687] __kasan_slab_free+0x10a/0x190 [ 24.327230] kmem_cache_free+0x10d/0x4d0 [ 24.327741] rcu_core+0x8c8/0x2860 [ 24.328191] __do_softirq+0x1b7/0x7d4 [ 24.328665] [ 24.328881] Last potentially related work creation: [ 24.329482] kasan_save_stack+0x22/0x50 [ 24.329983] __kasan_record_aux_stack+0x8e/0xa0 [ 24.330553] __call_rcu_common.constprop.0+0x6a/0xb90 [ 24.331191] remove_vma+0x139/0x170 [ 24.331649] do_vmi_align_munmap+0xd4a/0x11f0 [ 24.332203] do_vmi_munmap+0x1f1/0x2b0 [ 24.332728] __vm_munmap+0x138/0x3a0 [ 24.333197] __x64_sys_munmap+0x59/0x80 [ 24.333704] do_syscall_64+0x3f/0x90 [ 24.334184] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 24.334823] [ 24.335039] The buggy address belongs to the object at ffff88800ec6c910 [ 24.335039] which belongs to the cache vm_area_struct of size 168 [ 24.336481] The buggy address is located 88 bytes inside of [ 24.336481] freed 168-byte region [ffff88800ec6c910, ffff88800ec6c9b8) [ 24.337906] [ 24.338119] The buggy address belongs to the physical page: [ 24.338779] page:00000000838d2aa0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xec6c [ 24.339860] memcg:ffff888009a2a401 [ 24.340286] anon flags: 0x100000000000200(slab|node=0|zone=1) [ 24.340988] page_type: 0xffffffff() [ 24.341443] raw: 0100000000000200 ffff8880087a0c80 0000000000000000 dead000000000001 [ 24.342356] raw: 0000000000000000 0000000000110011 00000001ffffffff ffff888009a2a401 [ 24.343274] page dumped because: kasan: bad access detected [ 24.343935] [ 24.344155] Memory state around the buggy address: [ 24.344741] ffff88800ec6c800: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb [ 24.345627] ffff88800ec6c880: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc [ 24.346491] >ffff88800ec6c900: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb [ 24.347343] ^ [ 24.348125] ffff88800ec6c980: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc 00 [ 24.348979] ffff88800ec6ca00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 24.349825] ================================================================== [ 24.350741] Disabling lock debugging due to kernel taint Debian GNU/Linux 11 syzkaller ttyS0 syzkaller login: [ 26.771918] BUG: Bad rss-counter state mm:0000000007eb8023 type:MM_FILEPAGES val:33 [ 26.772899] BUG: Bad rss-counter state mm:0000000007eb8023 type:MM_ANONPAGES val:22 [ 27.240181] BUG: Bad rss-counter state mm:00000000f788037f type:MM_FILEPAGES val:33 [ 27.241191] BUG: Bad rss-counter state mm:00000000f788037f type:MM_ANONPAGES val:22 Warning: Permanently added '[localhost]:22128' (ECDSA) to the list of known hosts. [ 27.354643] general protection fault, probably for non-canonical address 0xe0837c0120000019: 0000 [#1] PREEMPT SMP KASAN NOPTI [ 27.356051] KASAN: maybe wild-memory-access in range [0x041c0009000000c8-0x041c0009000000cf] [ 27.357075] CPU: 0 PID: 237 Comm: sshd Tainted: G B 6.4.0-rc7-next-20230620 #1 [ 27.358114] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 [ 27.359213] RIP: 0010:__rb_insert_augmented+0x9d/0x8b0 [ 27.359992] Code: c2 48 c1 ea 03 42 80 3c 2a 00 0f 85 55 05 00 00 4d 8b 74 24 08 49 39 ee 0f 84 77 01 00 00 4d 85 f6 74 1c 4c 89 f2 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 61 05 00 00 41 f6 06 01 0f 84 7a 04 00 00 48 [ 27.362371] RSP: 0018:ffff8880163078a8 EFLAGS: 00010213 [ 27.363135] RAX: ffff8880187fa388 RBX: ffff888019948cf0 RCX: ffffffff844d49f9 [ 27.364152] RDX: 0083800120000019 RSI: 0000000000000008 RDI: ffff88800eb84e48 [ 27.365161] RBP: ffff8880161cc0c0 R08: ffff88800eb84e48 R09: 0000000000000000 [ 27.366196] R10: 0000000000000000 R11: 00000000000b6a61 R12: ffff88800eb84e40 [ 27.367232] R13: dffffc0000000000 R14: 041c0009000000cc R15: ffffffff816e6340 [ 27.368259] FS: 00007f883a1e8900(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000 [ 27.369412] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 27.370284] CR2: 00007f883a1bb000 CR3: 000000000e844000 CR4: 0000000000350ef0 [ 27.371123] Call Trace: [ 27.371430] [ 27.371703] ? die_addr+0x3c/0xa0 [ 27.372134] ? exc_general_protection+0x125/0x220 [ 27.372732] ? asm_exc_general_protection+0x26/0x30 [ 27.373346] ? __pfx_vma_interval_tree_augment_rotate+0x10/0x10 [ 27.374067] ? __rb_insert_augmented+0x5e9/0x8b0 [ 27.374644] ? __rb_insert_augmented+0x9d/0x8b0 [ 27.375212] ? __rb_insert_augmented+0x5e9/0x8b0 [ 27.375789] vma_prepare+0xa1a/0x11a0 [ 27.376252] __split_vma+0x5af/0x950 [ 27.376710] ? __pfx___split_vma+0x10/0x10 [ 27.377224] ? lock_acquire+0x434/0x4c0 [ 27.377715] do_vmi_align_munmap+0x361/0x11f0 [ 27.378269] ? __pfx_do_vmi_align_munmap+0x10/0x10 [ 27.378864] ? mtree_range_walk+0x632/0x900 [ 27.379400] ? mas_walk+0x5c7/0x7c0 [ 27.379862] do_vmi_munmap+0x1f1/0x2b0 [ 27.380335] mmap_region+0x1f9/0x2660 [ 27.380809] ? __pfx_arch_get_unmapped_area_topdown+0x10/0x10 [ 27.381523] ? __pfx_lock_acquire+0x10/0x10 [ 27.382041] ? __pfx_mmap_region+0x10/0x10 [ 27.382557] ? security_mmap_addr+0x7d/0xa0 [ 27.383079] ? get_unmapped_area+0x1f5/0x3f0 [ 27.383620] do_mmap+0x854/0xf00 [ 27.384048] vm_mmap_pgoff+0x1a6/0x3a0 [ 27.384542] ? __pfx_vm_mmap_pgoff+0x10/0x10 [ 27.385085] ksys_mmap_pgoff+0x3af/0x500 [ 27.385581] do_syscall_64+0x3f/0x90 [ 27.386046] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 27.386667] RIP: 0033:0x7f883ad7ad82 [ 27.387119] 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 [ 27.389178] RSP: 002b:00007ffed8ef2828 EFLAGS: 00000206 ORIG_RAX: 0000000000000009 [ 27.390068] RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007f883ad7ad82 [ 27.390890] RDX: 0000000000000005 RSI: 0000000000001000 RDI: 00007f883a1b4000 [ 27.391714] RBP: 00007f883a1b4000 R08: 0000000000000009 R09: 0000000000001000 [ 27.392541] R10: 0000000000000812 R11: 0000000000000206 R12: 000055e24cd77d90 [ 27.393367] R13: 00007ffed8ef2840 R14: 00007ffed8ef2870 R15: 00007ffed8ef2bd0 [ 27.394216] [ 27.394501] Modules linked in: [ 27.394991] ---[ end trace 0000000000000000 ]--- [ 27.395545] RIP: 0010:__rb_insert_augmented+0x9d/0x8b0 [ 27.396654] Code: c2 48 c1 ea 03 42 80 3c 2a 00 0f 85 55 05 00 00 4d 8b 74 24 08 49 39 ee 0f 84 77 01 00 00 4d 85 f6 74 1c 4c 89 f2 48 c1 ea 03 <42> 80 3c 2a 00 0f 85 61 05 00 00 41 f6 06 01 0f 84 7a 04 00 00 48 [ 27.399108] RSP: 0018:ffff8880163078a8 EFLAGS: 00010213 [ 27.399736] RAX: ffff8880187fa388 RBX: ffff888019948cf0 RCX: ffffffff844d49f9 [ 27.400755] RDX: 0083800120000019 RSI: 0000000000000008 RDI: ffff88800eb84e48 [ 27.401757] RBP: ffff8880161cc0c0 R08: ffff88800eb84e48 R09: 0000000000000000 [ 27.402704] R10: 0000000000000000 R11: 00000000000b6a61 R12: ffff88800eb84e40 [ 27.403576] R13: dffffc0000000000 R14: 041c0009000000cc R15: ffffffff816e6340 [ 27.404431] FS: 00007f883a1e8900(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000 [ 27.405374] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 27.406097] CR2: 00007f883a1bb000 CR3: 000000000e844000 CR4: 0000000000350ef0 VM DIAGNOSIS: 22:54:31 Registers: info registers vcpu 0 RAX=ffff88806ce35000 RBX=0000000000000000 RCX=ffffffff8451250e RDX=ffffed100d9c6a01 RSI=0000000000000004 RDI=ffffffff81288ac5 RBP=dffffc0000000000 RSP=ffffffff85407e10 R8 =0000000000000000 R9 =ffffed100d9c6a00 R10=ffff88806ce35003 R11=ffff888008c04000 R12=ffffffff85d3d350 R13=1ffffffff0a80fc7 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 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=00007ffc7198abb8 CR3=0000000018e86000 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=2031333a34353a3232203032206e754a XMM01=657463656e6e6f63736944203a5d3832 XMM02=302e303120746f6f722072657375206d XMM03=203a5d3832325b646873732072656c6c XMM04=69662068637573206f4e203a656c6163 XMM05=3a656c696620766e65206e65706f206f XMM06=65733a6468737328766e655f6d617020 XMM07=6b7a79732031333a34353a3232203032 XMM08=3d656e696c646d632022656369767265 XMM09=00000000000000000000000000000000 XMM10=00000000000000000000000000000000 XMM11=00000000000000000000000000000000 XMM12=00000000000000000000000000000000 XMM13=00000000000000000000000000000000 XMM14=00000000000000000000000000000000 XMM15=00000000000000000000000000000000 info registers vcpu 1 RAX=dffffc0000000000 RBX=ffffffff846000aa RCX=0000000000000001 RDX=1ffff1100286ff5e RSI=ffff88801437ff48 RDI=ffffffff846000aa RBP=ffffffff846000aa RSP=ffff88801437fa40 R8 =0000000000000001 R9 =ffff88801437fad8 R10=0000000000038001 R11=00000000000b5080 R12=ffff88801437fb60 R13=0000000000000000 R14=ffff888014211b40 R15=ffff88800e4edb80 RIP=ffffffff811fc6f7 RFL=00000292 [--S-A--] 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 00007f60b8a4e900 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=00007f60fcdde650 CR3=000000000d890000 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=ffffffffffffffffffffffffffffffff XMM01=30306234386136303638616663356134 XMM02=38303062343861363036386166633561 XMM03=2f6c616e72756f6a2f676f6c2f6e7572 XMM04=65b2a16182fb51d100000000000ae988 XMM05=60973acb179e8a020000000000132880 XMM06=806171799158d9670000000000131030 XMM07=00000000000000000000000000000000 XMM08=415453454d49545f454d49544c414552 XMM09=00000000000000000000000000000000 XMM10=00000000000000000000000000000000 XMM11=00000000000000000000000000000000 XMM12=00000000000000000000000000000000 XMM13=00000000000000000000000000000000 XMM14=00000000000000000000000000000000 XMM15=00000000000000000000000000000000