BUG: Bad rss-counter state mm:00000000d7c8fcad type:MM_FILEPAGES val:33
BUG: Bad rss-counter state mm:00000000d7c8fcad type:MM_ANONPAGES val:22
==================================================================
BUG: KASAN: slab-use-after-free in vma_interval_tree_remove+0xc75/0xec0
Read of size 8 at addr ffff88800d9b0a50 by task sshd/221
CPU: 1 PID: 221 Comm: sshd Not tainted 6.4.0-rc7-next-20230619 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
Call Trace:
dump_stack_lvl+0x91/0xf0
print_report+0xcc/0x620
kasan_report+0xbe/0xf0
vma_interval_tree_remove+0xc75/0xec0
vma_prepare+0xc54/0x11a0
__split_vma+0x5af/0x950
do_vmi_align_munmap+0x2ba/0x11f0
do_vmi_munmap+0x1f1/0x2b0
mmap_region+0x1f9/0x2660
do_mmap+0x854/0xf00
vm_mmap_pgoff+0x1a6/0x3a0
ksys_mmap_pgoff+0x3af/0x500
do_syscall_64+0x3f/0x90
entry_SYSCALL_64_after_hwframe+0x6e/0xd8
RIP: 0033:0x7f4a2d66ed82
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
RSP: 002b:00007ffc86786b08 EFLAGS: 00000206 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007f4a2d66ed82
RDX: 0000000000000005 RSI: 0000000000001000 RDI: 00007f4a2caa8000
RBP: 00007f4a2caa8000 R08: 0000000000000009 R09: 0000000000001000
R10: 0000000000000812 R11: 0000000000000206 R12: 0000560584acaec0
R13: 00007ffc86786b20 R14: 00007ffc86786b50 R15: 00007ffc86786eb0
Allocated by task 214:
kasan_save_stack+0x22/0x50
kasan_set_track+0x25/0x30
__kasan_slab_alloc+0x59/0x70
kmem_cache_alloc+0x16b/0x370
vm_area_dup+0x20/0x160
__split_vma+0x170/0x950
split_vma+0xc6/0x110
mprotect_fixup+0x8d2/0xb30
do_mprotect_pkey+0x87e/0xd40
__x64_sys_mprotect+0x78/0xc0
do_syscall_64+0x3f/0x90
entry_SYSCALL_64_after_hwframe+0x6e/0xd8
Freed by task 214:
kasan_save_stack+0x22/0x50
kasan_set_track+0x25/0x30
kasan_save_free_info+0x2b/0x50
__kasan_slab_free+0x10a/0x190
kmem_cache_free+0x10d/0x4d0
rcu_core+0x8c8/0x2860
__do_softirq+0x1b7/0x7d4
Last potentially related work creation:
kasan_save_stack+0x22/0x50
__kasan_record_aux_stack+0x8e/0xa0
__call_rcu_common.constprop.0+0x6a/0xb90
remove_vma+0x139/0x170
do_vmi_align_munmap+0xd4a/0x11f0
do_vmi_munmap+0x1f1/0x2b0
__vm_munmap+0x138/0x3a0
__x64_sys_munmap+0x59/0x80
do_syscall_64+0x3f/0x90
entry_SYSCALL_64_after_hwframe+0x6e/0xd8
The buggy address belongs to the object at ffff88800d9b09f8
which belongs to the cache vm_area_struct of size 168
The buggy address is located 88 bytes inside of
freed 168-byte region [ffff88800d9b09f8, ffff88800d9b0aa0)
The buggy address belongs to the physical page:
page:00000000e32c09d9 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0xd9b0
memcg:ffff88800e4dd201
flags: 0x100000000000200(slab|node=0|zone=1)
page_type: 0xffffffff()
raw: 0100000000000200 ffff88800879fc80 ffffea00003ac380 dead000000000006
raw: 0000000000000000 0000000000110011 00000001ffffffff ffff88800e4dd201
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88800d9b0900: fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88800d9b0980: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa
>ffff88800d9b0a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88800d9b0a80: fb fb fb fb fc fc fc fc fc fc fc fc 00 00 00 00
ffff88800d9b0b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
==================================================================
BUG: Bad rss-counter state mm:0000000086ce4df2 type:MM_FILEPAGES val:33
BUG: Bad rss-counter state mm:0000000086ce4df2 type:MM_ANONPAGES val:22
BUG: Bad rss-counter state mm:00000000a9e18f32 type:MM_FILEPAGES val:33
BUG: Bad rss-counter state mm:00000000a9e18f32 type:MM_ANONPAGES val:22
kmemleak: Automatic memory scanning thread ended
cgroup: Unknown subsys name 'net'
cgroup: Unknown subsys name 'rlimit'
general protection fault, probably for non-canonical address 0xe0a0dc2740000016: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: maybe wild-memory-access in range [0x0507013a000000b0-0x0507013a000000b7]
CPU: 0 PID: 265 Comm: cron Tainted: G B 6.4.0-rc7-next-20230619 #1
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014
RIP: 0010:__rb_insert_augmented+0x9d/0x8b0
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
RSP: 0018:ffff88800fbd78a8 EFLAGS: 00010213
RAX: ffff888018edc140 RBX: ffff88800fc072f8 RCX: ffffffff844ce9f9
RDX: 00a0e02740000016 RSI: 0000000000000008 RDI: ffff888018f2c110
RBP: ffff888009aa1bc0 R08: ffff888018f2c110 R09: 0000000000000000
R10: 0000000000000000 R11: 00000000000b6996 R12: ffff888018f2c108
R13: dffffc0000000000 R14: 0507013a000000b6 R15: ffffffff816e61c0
FS: 00007fcd2e21f840(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005634a442a2e8 CR3: 000000000c5e6000 CR4: 0000000000350ef0
Call Trace:
vma_prepare+0xa1a/0x11a0
__split_vma+0x5af/0x950
do_vmi_align_munmap+0x361/0x11f0
do_vmi_munmap+0x1f1/0x2b0
mmap_region+0x1f9/0x2660
do_mmap+0x854/0xf00
vm_mmap_pgoff+0x1a6/0x3a0
ksys_mmap_pgoff+0x3af/0x500
do_syscall_64+0x3f/0x90
entry_SYSCALL_64_after_hwframe+0x6e/0xd8
RIP: 0033:0x7fcd2e541d82
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
RSP: 002b:00007ffd00c598c8 EFLAGS: 00000206 ORIG_RAX: 0000000000000009
RAX: ffffffffffffffda RBX: 0000000000000812 RCX: 00007fcd2e541d82
RDX: 0000000000000005 RSI: 0000000000001000 RDI: 00007fcd2ddfb000
RBP: 00007fcd2ddfb000 R08: 0000000000000009 R09: 0000000000001000
R10: 0000000000000812 R11: 0000000000000206 R12: 00005634a4429e00
R13: 00007ffd00c598e0 R14: 00007ffd00c59910 R15: 00007ffd00c59c70
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__rb_insert_augmented+0x9d/0x8b0
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
RSP: 0018:ffff88800fbd78a8 EFLAGS: 00010213
RAX: ffff888018edc140 RBX: ffff88800fc072f8 RCX: ffffffff844ce9f9
RDX: 00a0e02740000016 RSI: 0000000000000008 RDI: ffff888018f2c110
RBP: ffff888009aa1bc0 R08: ffff888018f2c110 R09: 0000000000000000
R10: 0000000000000000 R11: 00000000000b6996 R12: ffff888018f2c108
R13: dffffc0000000000 R14: 0507013a000000b6 R15: ffffffff816e61c0
FS: 00007fcd2e21f840(0000) GS:ffff88806ce00000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005634a442a2e8 CR3: 000000000c5e6000 CR4: 0000000000350ef0
----------------
Code disassembly (best guess), 1 bytes skipped:
0: 48 c1 ea 03 shr $0x3,%rdx
4: 42 80 3c 2a 00 cmpb $0x0,(%rdx,%r13,1)
9: 0f 85 55 05 00 00 jne 0x564
f: 4d 8b 74 24 08 mov 0x8(%r12),%r14
14: 49 39 ee cmp %rbp,%r14
17: 0f 84 77 01 00 00 je 0x194
1d: 4d 85 f6 test %r14,%r14
20: 74 1c je 0x3e
22: 4c 89 f2 mov %r14,%rdx
25: 48 c1 ea 03 shr $0x3,%rdx
* 29: 42 80 3c 2a 00 cmpb $0x0,(%rdx,%r13,1) <-- trapping instruction
2e: 0f 85 61 05 00 00 jne 0x595
34: 41 f6 06 01 testb $0x1,(%r14)
38: 0f 84 7a 04 00 00 je 0x4b8
3e: 48 rex.W