linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [syzbot] [kvmarm?] kernel BUG in kvm_s2_put_page
@ 2025-09-19 14:20 syzbot
  2025-09-19 14:26 ` Marc Zyngier
  2025-10-29 20:04 ` syzbot
  0 siblings, 2 replies; 4+ messages in thread
From: syzbot @ 2025-09-19 14:20 UTC (permalink / raw)
  To: catalin.marinas, joey.gouly, kvmarm, linux-arm-kernel,
	linux-kernel, maz, oliver.upton, suzuki.poulose, syzkaller-bugs,
	will, yuzenghui

Hello,

syzbot found the following issue on:

HEAD commit:    62e68218ab58 Merge branch kvm-arm64/nv-debug into kvmarm-m..
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next
console output: https://syzkaller.appspot.com/x/log.txt?x=1551cf62580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=1b1bafe30fc85201
dashboard link: https://syzkaller.appspot.com/bug?extid=c41f3ddb8299a30a98b5
compiler:       Debian clang version 20.1.8 (++20250708123704+0de59a293f7a-1~exp1~20250708003721.134), Debian LLD 20.1.8
userspace arch: arm64

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/fa3fbcfdac58/non_bootable_disk-62e68218.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/99c4e665c20d/vmlinux-62e68218.xz
kernel image: https://storage.googleapis.com/syzbot-assets/4204d63db4b5/Image-62e68218.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c41f3ddb8299a30a98b5@syzkaller.appspotmail.com

raw: 01ffea8000000000 ffffc1ffc0807c48 ffffc1ffc080a888 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
------------[ cut here ]------------
kernel BUG at ./include/linux/mm.h:1036!
Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
Modules linked in:
CPU: 0 UID: 0 PID: 4079 Comm: syz.1.200 Not tainted syzkaller #0 PREEMPT 
Hardware name: linux,dummy-virt (DT)
pstate: 60402009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : put_page_testzero include/linux/mm.h:1036 [inline]
pc : folio_put_testzero include/linux/mm.h:1042 [inline]
pc : folio_put include/linux/mm.h:1359 [inline]
pc : put_page include/linux/mm.h:1429 [inline]
pc : kvm_s2_put_page+0x374/0x3a0 arch/arm64/kvm/mmu.c:264
lr : put_page_testzero include/linux/mm.h:1036 [inline]
lr : folio_put_testzero include/linux/mm.h:1042 [inline]
lr : folio_put include/linux/mm.h:1359 [inline]
lr : put_page include/linux/mm.h:1429 [inline]
lr : kvm_s2_put_page+0x374/0x3a0 arch/arm64/kvm/mmu.c:264
sp : ffff80008edd7570
x29: ffff80008edd7570 x28: a4f00000202a2000 x27: a4f00000202a2000
x26: 00000000000000ff x25: ffff80008734e000 x24: ffffc1ffc0000000
x23: ffffc1ffc0806908 x22: 0000000000000000 x21: ffffc1ffc0806934
x20: 0000000000000000 x19: ffffc1ffc0806900 x18: 000000004afc0585
x17: 0000000004687c8c x16: 000000004af050f5 x15: 0000000089957307
x14: ffffffffffffffff x13: fff0000012103b08 x12: 0000000000000001
x11: 0000000000080000 x10: 0000000000031ed7 x9 : c866620449182600
x8 : c866620449182600 x7 : ffff80008039fbc8 x6 : 0000000000000000
x5 : 0000000000000001 x4 : 0000000000000001 x3 : ffff800080390dd0
x2 : 0000000000000002 x1 : 0000000100000000 x0 : 000000000000003e
Call trace:
 put_page_testzero include/linux/mm.h:1036 [inline] (P)
 folio_put_testzero include/linux/mm.h:1042 [inline] (P)
 folio_put include/linux/mm.h:1359 [inline] (P)
 put_page include/linux/mm.h:1429 [inline] (P)
 kvm_s2_put_page+0x374/0x3a0 arch/arm64/kvm/mmu.c:264 (P)
 stage2_free_walker+0x1b0/0x264 arch/arm64/kvm/hyp/pgtable.c:1549
 kvm_pgtable_visitor_cb arch/arm64/kvm/hyp/pgtable.c:130 [inline]
 __kvm_pgtable_visit arch/arm64/kvm/hyp/pgtable.c:212 [inline]
 __kvm_pgtable_walk+0x7d8/0xa68 arch/arm64/kvm/hyp/pgtable.c:237
 _kvm_pgtable_walk arch/arm64/kvm/hyp/pgtable.c:260 [inline]
 kvm_pgtable_walk+0x294/0x468 arch/arm64/kvm/hyp/pgtable.c:283
 kvm_pgtable_stage2_destroy_range+0x60/0xb4 arch/arm64/kvm/hyp/pgtable.c:1563
 stage2_destroy_range arch/arm64/kvm/mmu.c:924 [inline]
 kvm_stage2_destroy arch/arm64/kvm/mmu.c:935 [inline]
 kvm_free_stage2_pgd+0x198/0x28c arch/arm64/kvm/mmu.c:1112
 kvm_uninit_stage2_mmu+0x20/0x38 arch/arm64/kvm/mmu.c:1023
 kvm_arch_flush_shadow_all+0x1a8/0x1e0 arch/arm64/kvm/nested.c:1113
 kvm_flush_shadow_all virt/kvm/kvm_main.c:343 [inline]
 kvm_mmu_notifier_release+0x48/0xa8 virt/kvm/kvm_main.c:884
 mmu_notifier_unregister+0x128/0x42c mm/mmu_notifier.c:815
 kvm_destroy_vm virt/kvm/kvm_main.c:1295 [inline]
 kvm_put_kvm+0x6a0/0xfa8 virt/kvm/kvm_main.c:1353
 kvm_vcpu_release+0x70/0x9c virt/kvm/kvm_main.c:4100
 __fput+0x4ac/0x980 fs/file_table.c:468
 ____fput+0x20/0x58 fs/file_table.c:496
 task_work_run+0x1bc/0x254 kernel/task_work.c:227
 get_signal+0x13ec/0x1554 kernel/signal.c:2807
 do_signal+0x23c/0x4dd0 arch/arm64/kernel/signal.c:1618
 do_notify_resume+0xb0/0x270 arch/arm64/kernel/entry-common.c:152
 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:173 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:182 [inline]
 el0_svc+0xb8/0x164 arch/arm64/kernel/entry-common.c:880
 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596
Code: f00375a1 9112fc21 aa1303e0 97f9c9f2 (d4210000) 
---[ end trace 0000000000000000 ]---


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [kvmarm?] kernel BUG in kvm_s2_put_page
  2025-09-19 14:20 [syzbot] [kvmarm?] kernel BUG in kvm_s2_put_page syzbot
@ 2025-09-19 14:26 ` Marc Zyngier
  2025-10-29 20:04 ` syzbot
  1 sibling, 0 replies; 4+ messages in thread
From: Marc Zyngier @ 2025-09-19 14:26 UTC (permalink / raw)
  To: syzbot
  Cc: catalin.marinas, joey.gouly, kvmarm, linux-arm-kernel,
	linux-kernel, oliver.upton, suzuki.poulose, syzkaller-bugs, will,
	yuzenghui

On Fri, 19 Sep 2025 15:20:32 +0100,
syzbot <syzbot+c41f3ddb8299a30a98b5@syzkaller.appspotmail.com> wrote:
> 
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    62e68218ab58 Merge branch kvm-arm64/nv-debug into kvmarm-m..
> git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next
> console output: https://syzkaller.appspot.com/x/log.txt?x=1551cf62580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=1b1bafe30fc85201
> dashboard link: https://syzkaller.appspot.com/bug?extid=c41f3ddb8299a30a98b5
> compiler:       Debian clang version 20.1.8 (++20250708123704+0de59a293f7a-1~exp1~20250708003721.134), Debian LLD 20.1.8
> userspace arch: arm64
> 
> Unfortunately, I don't have any reproducer for this issue yet.
> 
> Downloadable assets:
> disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/fa3fbcfdac58/non_bootable_disk-62e68218.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/99c4e665c20d/vmlinux-62e68218.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/4204d63db4b5/Image-62e68218.gz.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+c41f3ddb8299a30a98b5@syzkaller.appspotmail.com
> 
> raw: 01ffea8000000000 ffffc1ffc0807c48 ffffc1ffc080a888 0000000000000000
> raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
> page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
> ------------[ cut here ]------------
> kernel BUG at ./include/linux/mm.h:1036!
> Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
> Modules linked in:
> CPU: 0 UID: 0 PID: 4079 Comm: syz.1.200 Not tainted syzkaller #0 PREEMPT 
> Hardware name: linux,dummy-virt (DT)
> pstate: 60402009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> pc : put_page_testzero include/linux/mm.h:1036 [inline]
> pc : folio_put_testzero include/linux/mm.h:1042 [inline]
> pc : folio_put include/linux/mm.h:1359 [inline]
> pc : put_page include/linux/mm.h:1429 [inline]
> pc : kvm_s2_put_page+0x374/0x3a0 arch/arm64/kvm/mmu.c:264
> lr : put_page_testzero include/linux/mm.h:1036 [inline]
> lr : folio_put_testzero include/linux/mm.h:1042 [inline]
> lr : folio_put include/linux/mm.h:1359 [inline]
> lr : put_page include/linux/mm.h:1429 [inline]
> lr : kvm_s2_put_page+0x374/0x3a0 arch/arm64/kvm/mmu.c:264

This is likely caused by the S2 refcounting issue that has just been
reverted in Linus' tree, and that is not in the kvmarm/next branch.

	M.

-- 
Jazz isn't dead. It just smells funny.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [kvmarm?] kernel BUG in kvm_s2_put_page
  2025-09-19 14:20 [syzbot] [kvmarm?] kernel BUG in kvm_s2_put_page syzbot
  2025-09-19 14:26 ` Marc Zyngier
@ 2025-10-29 20:04 ` syzbot
  2025-10-29 20:27   ` Oliver Upton
  1 sibling, 1 reply; 4+ messages in thread
From: syzbot @ 2025-10-29 20:04 UTC (permalink / raw)
  To: catalin.marinas, joey.gouly, kvmarm, linux-arm-kernel,
	linux-kernel, maz, oliver.upton, suzuki.poulose, syzkaller-bugs,
	will, yuzenghui

syzbot has found a reproducer for the following issue on:

HEAD commit:    10fd0285305d Merge branch kvm-arm64/selftests-6.18 into kv..
git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next
console output: https://syzkaller.appspot.com/x/log.txt?x=173e4fe2580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=a4522b3a704e0394
dashboard link: https://syzkaller.appspot.com/bug?extid=c41f3ddb8299a30a98b5
compiler:       Debian clang version 20.1.8 (++20250708123704+0de59a293f7a-1~exp1~20250708003721.134), Debian LLD 20.1.8
userspace arch: arm64
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13559c92580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12963fe2580000

Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/fa3fbcfdac58/non_bootable_disk-10fd0285.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/65e2ebd050e3/vmlinux-10fd0285.xz
kernel image: https://storage.googleapis.com/syzbot-assets/9d47fc3df12e/Image-10fd0285.gz.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+c41f3ddb8299a30a98b5@syzkaller.appspotmail.com

raw: 01fff1c000000000 ffffc1ffc08742c8 ffffc1ffc07b2488 0000000000000000
raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
page dumped because: VM_BUG_ON_PAGE(page_ref_count(page) == 0)
------------[ cut here ]------------
kernel BUG at ./include/linux/mm.h:1036!
Internal error: Oops - BUG: 00000000f2000800 [#1]  SMP
Modules linked in:
CPU: 0 UID: 0 PID: 3630 Comm: syz.2.17 Not tainted syzkaller #0 PREEMPT 
Hardware name: linux,dummy-virt (DT)
pstate: 61402009 (nZCv daif +PAN -UAO -TCO +DIT -SSBS BTYPE=--)
pc : put_page_testzero include/linux/mm.h:1036 [inline]
pc : folio_put_testzero include/linux/mm.h:1042 [inline]
pc : folio_put include/linux/mm.h:1359 [inline]
pc : put_page include/linux/mm.h:1429 [inline]
pc : kvm_s2_put_page+0x374/0x3a0 arch/arm64/kvm/mmu.c:264
lr : put_page_testzero include/linux/mm.h:1036 [inline]
lr : folio_put_testzero include/linux/mm.h:1042 [inline]
lr : folio_put include/linux/mm.h:1359 [inline]
lr : put_page include/linux/mm.h:1429 [inline]
lr : kvm_s2_put_page+0x374/0x3a0 arch/arm64/kvm/mmu.c:264
sp : ffff80008e717450
x29: ffff80008e717450 x28: bff000001ec92000 x27: bff000001ec92000
x26: 00000000000000ff x25: ffff800087396000 x24: ffffc1ffc0000000
x23: ffffc1ffc0874288 x22: 0000000000000000 x21: ffffc1ffc08742b4
x20: 0000000000000000 x19: ffffc1ffc0874280 x18: 00000000fb20c077
x17: 00000000057d7f34 x16: 00000000fb1a5197 x15: 00000000866b9677
x14: ffffffffffffffff x13: fff0000015a39d88 x12: 0000000000000001
x11: 0000000000000000 x10: 0000000000ff0100 x9 : a6a806ed1668b300
x8 : a6a806ed1668b300 x7 : ffff80008039fbc8 x6 : 0000000000000000
x5 : 0000000000000001 x4 : 0000000000000001 x3 : ffff80008074aff8
x2 : 0000000000000001 x1 : 0000000100000000 x0 : 000000000000003e
Call trace:
 put_page_testzero include/linux/mm.h:1036 [inline] (P)
 folio_put_testzero include/linux/mm.h:1042 [inline] (P)
 folio_put include/linux/mm.h:1359 [inline] (P)
 put_page include/linux/mm.h:1429 [inline] (P)
 kvm_s2_put_page+0x374/0x3a0 arch/arm64/kvm/mmu.c:264 (P)
 stage2_free_walker+0x1b0/0x264 arch/arm64/kvm/hyp/pgtable.c:1549
 kvm_pgtable_visitor_cb arch/arm64/kvm/hyp/pgtable.c:130 [inline]
 __kvm_pgtable_visit arch/arm64/kvm/hyp/pgtable.c:212 [inline]
 __kvm_pgtable_walk+0x7d8/0xa68 arch/arm64/kvm/hyp/pgtable.c:237
 _kvm_pgtable_walk arch/arm64/kvm/hyp/pgtable.c:260 [inline]
 kvm_pgtable_walk+0x294/0x468 arch/arm64/kvm/hyp/pgtable.c:283
 kvm_pgtable_stage2_destroy_range+0x60/0xb4 arch/arm64/kvm/hyp/pgtable.c:1563
 stage2_destroy_range arch/arm64/kvm/mmu.c:924 [inline]
 kvm_stage2_destroy arch/arm64/kvm/mmu.c:935 [inline]
 kvm_free_stage2_pgd+0x198/0x28c arch/arm64/kvm/mmu.c:1112
 kvm_uninit_stage2_mmu+0x20/0x38 arch/arm64/kvm/mmu.c:1023
 kvm_arch_flush_shadow_all+0x1a8/0x1e0 arch/arm64/kvm/nested.c:1113
 kvm_flush_shadow_all virt/kvm/kvm_main.c:343 [inline]
 kvm_mmu_notifier_release+0x48/0xa8 virt/kvm/kvm_main.c:884
 mn_hlist_release mm/mmu_notifier.c:321 [inline]
 __mmu_notifier_release+0x310/0x614 mm/mmu_notifier.c:359
 mmu_notifier_release include/linux/mmu_notifier.h:402 [inline]
 exit_mmap+0xb8/0xbb8 mm/mmap.c:1263
 __mmput+0x10c/0x528 kernel/fork.c:1130
 mmput+0x70/0xac kernel/fork.c:1152
 exit_mm+0x158/0x258 kernel/exit.c:582
 do_exit+0x788/0x2378 kernel/exit.c:949
 do_group_exit+0x1d4/0x2ac kernel/exit.c:1102
 get_signal+0x1440/0x1554 kernel/signal.c:3034
 do_signal+0x23c/0x4dd0 arch/arm64/kernel/signal.c:1618
 do_notify_resume+0xb0/0x270 arch/arm64/kernel/entry-common.c:152
 exit_to_user_mode_prepare arch/arm64/kernel/entry-common.c:173 [inline]
 exit_to_user_mode arch/arm64/kernel/entry-common.c:182 [inline]
 el0_svc+0xb8/0x164 arch/arm64/kernel/entry-common.c:880
 el0t_64_sync_handler+0x84/0x12c arch/arm64/kernel/entry-common.c:898
 el0t_64_sync+0x198/0x19c arch/arm64/kernel/entry.S:596
Code: 900377c1 910e9421 aa1303e0 97f9c9f2 (d4210000) 
---[ end trace 0000000000000000 ]---


---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [syzbot] [kvmarm?] kernel BUG in kvm_s2_put_page
  2025-10-29 20:04 ` syzbot
@ 2025-10-29 20:27   ` Oliver Upton
  0 siblings, 0 replies; 4+ messages in thread
From: Oliver Upton @ 2025-10-29 20:27 UTC (permalink / raw)
  To: syzbot
  Cc: catalin.marinas, joey.gouly, kvmarm, linux-arm-kernel,
	linux-kernel, maz, suzuki.poulose, syzkaller-bugs, will,
	yuzenghui

On Wed, Oct 29, 2025 at 01:04:27PM -0700, syzbot wrote:
> syzbot has found a reproducer for the following issue on:
> 
> HEAD commit:    10fd0285305d Merge branch kvm-arm64/selftests-6.18 into kv..
> git tree:       git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git next
> console output: https://syzkaller.appspot.com/x/log.txt?x=173e4fe2580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=a4522b3a704e0394
> dashboard link: https://syzkaller.appspot.com/bug?extid=c41f3ddb8299a30a98b5
> compiler:       Debian clang version 20.1.8 (++20250708123704+0de59a293f7a-1~exp1~20250708003721.134), Debian LLD 20.1.8
> userspace arch: arm64
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=13559c92580000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=12963fe2580000
> 
> Downloadable assets:
> disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/fa3fbcfdac58/non_bootable_disk-10fd0285.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/65e2ebd050e3/vmlinux-10fd0285.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/9d47fc3df12e/Image-10fd0285.gz.xz
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+c41f3ddb8299a30a98b5@syzkaller.appspotmail.com

#syz fix: Revert "KVM: arm64: Reschedule as needed when destroying the stage-2 page-tables"

Just fast-forwarded kvmarm/next to 6.18-rc3 which has the fix.

Thanks,
Oliver


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-29 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19 14:20 [syzbot] [kvmarm?] kernel BUG in kvm_s2_put_page syzbot
2025-09-19 14:26 ` Marc Zyngier
2025-10-29 20:04 ` syzbot
2025-10-29 20:27   ` Oliver Upton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).