[ 23.473825] BUG: Bad rss-counter state mm:000000008aadbec2 type:MM_FILEPAGES val:33 [ 23.474439] BUG: Bad rss-counter state mm:000000008aadbec2 type:MM_ANONPAGES val:22 [ OK ] Started Serial Getty on ttyS0. [ OK ] Reached target Login Prompts. [ OK ] Started OpenBSD Secure Shell server. [ OK ] Reached target Multi-User System. [ OK ] Reached target Graphical Interface. Starting Update UTMP about System Runlevel Changes... [ 23.577251] ================================================================== [ 23.577745] BUG: KASAN: slab-use-after-free in vma_interval_tree_remove+0xc75/0xec0 [ 23.578257] Read of size 8 at addr ffff88801a56f798 by task sshd/220 [ 23.578685] [ 23.578805] CPU: 0 PID: 220 Comm: sshd Not tainted 6.4.0-rc7-next-20230620 #1 [ 23.579266] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 [ 23.579794] Call Trace: [ 23.579969] [ 23.580133] dump_stack_lvl+0x91/0xf0 [ 23.580399] print_report+0xcc/0x620 [ 23.580662] ? __virt_addr_valid+0x102/0x340 [ 23.580956] ? vma_interval_tree_remove+0xc75/0xec0 [ 23.581289] ? vma_interval_tree_remove+0xc75/0xec0 [ 23.581620] kasan_report+0xbe/0xf0 [ 23.581880] ? vma_interval_tree_remove+0xc75/0xec0 [ 23.582216] vma_interval_tree_remove+0xc75/0xec0 [ 23.582563] vma_prepare+0xc54/0x11a0 [ 23.582824] __split_vma+0x5af/0x950 [ 23.583080] ? __pfx___split_vma+0x10/0x10 [ 23.583371] ? find_held_lock+0x2c/0x110 [ 23.583655] do_vmi_align_munmap+0x2ba/0x11f0 [ 23.583959] ? lock_is_held_type+0x9f/0x120 [ 23.584253] ? __pfx_do_vmi_align_munmap+0x10/0x10 [ 23.584582] ? mtree_range_walk+0x632/0x900 [ 23.584880] ? mas_walk+0x5c7/0x7c0 [ 23.585136] do_vmi_munmap+0x1f1/0x2b0 [ 23.585404] mmap_region+0x1f9/0x2660 [ 23.585667] ? vm_mmap_pgoff+0x15c/0x3a0 [ 23.585942] ? __pfx_arch_get_unmapped_area_topdown+0x10/0x10 [ 23.586358] ? __pfx_lock_acquire+0x10/0x10 [ 23.586663] ? __pfx_mmap_region+0x10/0x10 [ 23.586961] ? security_mmap_addr+0x7d/0xa0 [ 23.587264] ? get_unmapped_area+0x1f5/0x3f0 [ 23.587579] do_mmap+0x854/0xf00 [ 23.587827] vm_mmap_pgoff+0x1a6/0x3a0 [ 23.588104] ? __pfx_vm_mmap_pgoff+0x10/0x10 [ 23.588419] ksys_mmap_pgoff+0x3af/0x500 [ 23.588704] do_syscall_64+0x3f/0x90 [ 23.588974] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 23.589345] RIP: 0033:0x7f432739bd82 [ 23.589603] 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.590852] RSP: 002b:00007fff61cfc818 EFLAGS: 00000206 ORIG_RAX: 0000000000000009 [ 23.591375] RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007f432739bd82 [ 23.591994] RDX: 0000000000000005 RSI: 0000000000001000 RDI: 00007f43267d5000 [ 23.592480] RBP: 00007f43267d5000 R08: 0000000000000009 R09: 0000000000001000 [ 23.592956] R10: 0000000000000812 R11: 0000000000000206 R12: 00005597f34b8ec0 [ 23.593456] R13: 00007fff61cfc830 R14: 00007fff61cfc860 R15: 00007fff61cfcbc0 [ 23.593950] [ 23.594119] [ 23.594243] Allocated by task 205: [ 23.594494] kasan_save_stack+0x22/0x50 [ 23.594780] kasan_set_track+0x25/0x30 [ 23.595062] __kasan_slab_alloc+0x59/0x70 [ 23.595357] kmem_cache_alloc+0x16b/0x370 [ 23.595649] vm_area_dup+0x20/0x160 [ 23.595911] __split_vma+0x170/0x950 [ 23.596177] split_vma+0xc6/0x110 [ 23.596429] mprotect_fixup+0x8d2/0xb30 [ 23.596713] do_mprotect_pkey+0x87e/0xd40 [ 23.597009] __x64_sys_mprotect+0x78/0xc0 [ 23.597304] do_syscall_64+0x3f/0x90 [ 23.597572] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 23.597935] [ 23.598054] Freed by task 203: [ 23.598271] kasan_save_stack+0x22/0x50 [ 23.598567] kasan_set_track+0x25/0x30 [ 23.598851] kasan_save_free_info+0x2b/0x50 [ 23.599149] __kasan_slab_free+0x10a/0x190 [ 23.599449] kmem_cache_free+0x10d/0x4d0 [ 23.599736] rcu_core+0x8c8/0x2860 [ 23.599984] __do_softirq+0x1b7/0x7d4 [ 23.600255] [ 23.600375] Last potentially related work creation: [ 23.600710] kasan_save_stack+0x22/0x50 [ 23.600993] __kasan_record_aux_stack+0x8e/0xa0 [ 23.601317] __call_rcu_common.constprop.0+0x6a/0xb90 [ 23.601676] remove_vma+0x139/0x170 [ 23.601928] do_vmi_align_munmap+0xd4a/0x11f0 [ 23.602244] do_vmi_munmap+0x1f1/0x2b0 [ 23.602545] __vm_munmap+0x138/0x3a0 [ 23.602814] __x64_sys_munmap+0x59/0x80 [ 23.603094] do_syscall_64+0x3f/0x90 [ 23.603362] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 23.603727] [ 23.603848] The buggy address belongs to the object at ffff88801a56f740 [ 23.603848] which belongs to the cache vm_area_struct of size 168 [ 23.604691] The buggy address is located 88 bytes inside of [ 23.604691] freed 168-byte region [ffff88801a56f740, ffff88801a56f7e8) [ 23.605487] [ 23.605609] The buggy address belongs to the physical page: [ 23.605994] page:00000000f6255e8e refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1a56f [ 23.606614] memcg:ffff88801a55f201 [ 23.606854] flags: 0x100000000000200(slab|node=0|zone=1) [ 23.607218] page_type: 0xffffffff() [ 23.607476] raw: 0100000000000200 ffff8880087a0c80 dead000000000122 0000000000000000 [ 23.608011] raw: 0000000000000000 0000000000110011 00000001ffffffff ffff88801a55f201 [ 23.608531] page dumped because: kasan: bad access detected [ 23.608909] [ 23.609034] Memory state around the buggy address: [ 23.609363] ffff88801a56f680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 [ 23.609853] ffff88801a56f700: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb [ 23.610343] >ffff88801a56f780: fb fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc [ 23.610840] ^ [ 23.611115] ffff88801a56f800: fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb fb [ 23.611599] ffff88801a56f880: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc [ 23.612081] ================================================================== [ 23.612631] Disabling lock debugging due to kernel taint [ OK ] Finished Update UTMP about System Runlevel Changes. Debian GNU/Linux 11 syzkaller ttyS0 syzkaller login: [ 25.483709] BUG: Bad rss-counter state mm:000000000bd45a15 type:MM_FILEPAGES val:33 [ 25.484862] BUG: Bad rss-counter state mm:000000000bd45a15 type:MM_ANONPAGES val:22 [ 25.942643] BUG: Bad rss-counter state mm:00000000eb9d7880 type:MM_FILEPAGES val:33 [ 25.943804] BUG: Bad rss-counter state mm:00000000eb9d7880 type:MM_ANONPAGES val:22 Warning: Permanently added '[localhost]:49486' (ECDSA) to the list of known hosts. [ 25.979616] general protection fault, probably for non-canonical address 0xe0877c012000001c: 0000 [#1] PREEMPT SMP KASAN NOPTI [ 25.981009] KASAN: maybe wild-memory-access in range [0x043c0009000000e0-0x043c0009000000e7] [ 25.982095] CPU: 1 PID: 237 Comm: sshd Tainted: G B 6.4.0-rc7-next-20230620 #1 [ 25.983213] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 [ 25.984185] RIP: 0010:__rb_insert_augmented+0x9d/0x8b0 [ 25.984859] 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 [ 25.987011] RSP: 0018:ffff8880159478a8 EFLAGS: 00010213 [ 25.987650] RAX: ffff888019383758 RBX: ffff888015915c08 RCX: ffffffff844d49f9 [ 25.988499] RDX: 008780012000001c RSI: 0000000000000008 RDI: ffff88800efe1398 [ 25.989348] RBP: ffff88801633e5c0 R08: ffff88800efe1398 R09: 0000000000000000 [ 25.990200] R10: 0000000000000000 R11: 00000000000b6a61 R12: ffff88800efe1390 [ 25.991059] R13: dffffc0000000000 R14: 043c0009000000e4 R15: ffffffff816e6340 [ 25.991914] FS: 00007fad4ac2d900(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 [ 25.992875] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 25.993581] CR2: 00007fad4abf9000 CR3: 000000001a74a000 CR4: 0000000000350ee0 [ 25.994435] Call Trace: [ 25.994764] [ 25.995050] ? die_addr+0x3c/0xa0 [ 25.995493] ? exc_general_protection+0x125/0x220 [ 25.996111] ? asm_exc_general_protection+0x26/0x30 [ 25.996741] ? __pfx_vma_interval_tree_augment_rotate+0x10/0x10 [ 25.997489] ? __rb_insert_augmented+0x5e9/0x8b0 [ 25.998086] ? __rb_insert_augmented+0x9d/0x8b0 [ 25.998698] ? __rb_insert_augmented+0x5e9/0x8b0 [ 25.999316] vma_prepare+0xa1a/0x11a0 [ 25.999798] __split_vma+0x5af/0x950 [ 26.000273] ? __pfx___split_vma+0x10/0x10 [ 26.000797] ? lock_acquire+0x434/0x4c0 [ 26.001301] do_vmi_align_munmap+0x361/0x11f0 [ 26.001873] ? __pfx_do_vmi_align_munmap+0x10/0x10 [ 26.002490] ? mtree_range_walk+0x632/0x900 [ 26.003044] ? mas_walk+0x5c7/0x7c0 [ 26.003524] do_vmi_munmap+0x1f1/0x2b0 [ 26.004021] mmap_region+0x1f9/0x2660 [ 26.004509] ? __pfx_arch_get_unmapped_area_topdown+0x10/0x10 [ 26.005241] ? __pfx_lock_acquire+0x10/0x10 [ 26.005775] ? __pfx_mmap_region+0x10/0x10 [ 26.006311] ? security_mmap_addr+0x7d/0xa0 [ 26.006891] ? get_unmapped_area+0x1f5/0x3f0 [ 26.007443] do_mmap+0x854/0xf00 [ 26.007878] vm_mmap_pgoff+0x1a6/0x3a0 [ 26.008377] ? __pfx_vm_mmap_pgoff+0x10/0x10 [ 26.008940] ksys_mmap_pgoff+0x3af/0x500 [ 26.009447] do_syscall_64+0x3f/0x90 [ 26.009926] entry_SYSCALL_64_after_hwframe+0x6e/0xd8 [ 26.010579] RIP: 0033:0x7fad4b7bfd82 [ 26.011036] 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 [ 26.013160] RSP: 002b:00007ffdfae694c8 EFLAGS: 00000206 ORIG_RAX: 0000000000000009 [ 26.014054] RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007fad4b7bfd82 [ 26.014912] RDX: 0000000000000005 RSI: 0000000000001000 RDI: 00007fad4abf4000 [ 26.015759] RBP: 00007fad4abf4000 R08: 0000000000000009 R09: 0000000000001000 [ 26.016597] R10: 0000000000000812 R11: 0000000000000206 R12: 00005560dc822000 [ 26.017456] R13: 00007ffdfae694e0 R14: 00007ffdfae69510 R15: 00007ffdfae69870 [ 26.018319] [ 26.018626] Modules linked in: [ 26.019087] ---[ end trace 0000000000000000 ]--- [ 26.019676] RIP: 0010:__rb_insert_augmented+0x9d/0x8b0 [ 26.020358] 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 [ 26.022797] RSP: 0018:ffff8880159478a8 EFLAGS: 00010213 [ 26.023677] RAX: ffff888019383758 RBX: ffff888015915c08 RCX: ffffffff844d49f9 [ 26.024818] RDX: 008780012000001c RSI: 0000000000000008 RDI: ffff88800efe1398 [ 26.025890] RBP: ffff88801633e5c0 R08: ffff88800efe1398 R09: 0000000000000000 [ 26.026851] R10: 0000000000000000 R11: 00000000000b6a61 R12: ffff88800efe1390 [ 26.027731] R13: dffffc0000000000 R14: 043c0009000000e4 R15: ffffffff816e6340 [ 26.028607] FS: 00007fad4ac2d900(0000) GS:ffff88806cf00000(0000) knlGS:0000000000000000 [ 26.029578] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 26.030309] CR2: 00007fad4abf9000 CR3: 000000001a74a000 CR4: 0000000000350ee0 VM DIAGNOSIS: 13:29:42 Registers: info registers vcpu 0 RAX=ffff88800e648001 RBX=ffff88800e647aa8 RCX=0000000000000001 RDX=ffff88800e647ab0 RSI=ffff88800e647a78 RDI=ffff88800e647638 RBP=ffff88800e640000 RSP=ffff88800e6475b8 R8 =0000000000000001 R9 =ffff88800e647668 R10=0000000000038001 R11=000000000002b987 R12=ffff88800e647688 R13=ffff88800e647670 R14=ffff88800e647a78 R15=ffff88800e647628 RIP=ffffffff8113128d RFL=00000287 [--S--PC] 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 00007fbec3fff700 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=00007ffd56d25000 CR3=000000000d980000 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=2032343a39323a3331203032206e754a XMM01=73732878696e755f6d6170203a5d3832 XMM02=65736f6c63206e6f6973736573203a29 XMM03=755f6d6170203a5d3832325b64687373 XMM04=69662068637573206f4e203a656c6163 XMM05=3a656c696620766e65206e65706f206f XMM06=65733a6468737328766e655f6d617020 XMM07=6b7a79732032343a39323a3331203032 XMM08=3d656e696c646d632022656369767265 XMM09=00000000000000000000000000000000 XMM10=00000000000000000000000000000000 XMM11=00000000000000000000000000000000 XMM12=00000000000000000000000000000000 XMM13=00000000000000000000000000000000 XMM14=00000000000000000000000000000000 XMM15=00000000000000000000000000000000 info registers vcpu 1 RAX=ffffffff860d258b RBX=0000000000000002 RCX=ffffffff860d2586 RDX=0000000000000000 RSI=0000000000000000 RDI=0000000000000001 RBP=ffff88806cf09ac8 RSP=ffff88806cf09a00 R8 =ffffffff860d258a R9 =ffff88806cf09ab0 R10=0000000000038001 R11=000000000000fc0c R12=ffff88806cf09ad0 R13=ffff88806cf09ab8 R14=ffff88806cf09e30 R15=ffff88806cf09a70 RIP=ffffffff8113113c 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 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=00007f9af28482a0 CR3=000000000eae4000 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=f31c024e34cbfb81524eb1513489f025 XMM02=000000000011a830ec2efd57dc4c00df XMM03=000000000011c8b87c1a80d7cad52274 XMM04=0056424ec4f478b900000000000ae988 XMM05=dfcdbad4f1609c370000000000131188 XMM06=806171799158d9670000000000131010 XMM07=e042d86d42eb936e000000000011cb90 XMM08=7c1a80d7cad52274000000000011a890 XMM09=00000000000000000000000000000000 XMM10=00000000000000000000000000000000 XMM11=00000000000000000000000000000000 XMM12=00000000000000000000000000000000 XMM13=00000000000000000000000000000000 XMM14=00000000000000000000000000000000 XMM15=00000000000000000000000000000000