Commit 43fb96a
KVM: x86/mmu: Ensure NX huge page recovery thread is alive before waking
When waking a VM's NX huge page recovery thread, ensure the thread is
actually alive before trying to wake it. Now that the thread is spawned
on-demand during KVM_RUN, a VM without a recovery thread is reachable via
the related module params.
BUG: kernel NULL pointer dereference, address: 0000000000000040
#PF: supervisor read access in kernel mode
#PF: error_code(0x0000) - not-present page
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015
RIP: 0010:vhost_task_wake+0x5/0x10
Call Trace:
<TASK>
set_nx_huge_pages+0xcc/0x1e0 [kvm]
param_attr_store+0x8a/0xd0
module_attr_store+0x1a/0x30
kernfs_fop_write_iter+0x12f/0x1e0
vfs_write+0x233/0x3e0
ksys_write+0x60/0xd0
do_syscall_64+0x5b/0x160
entry_SYSCALL_64_after_hwframe+0x4b/0x53
RIP: 0033:0x7f3b52710104
</TASK>
Modules linked in: kvm_intel kvm
CR2: 0000000000000040
Fixes: 931656b ("kvm: defer huge page recovery vhost task to later")
Cc: stable@vger.kernel.org
Cc: Keith Busch <kbusch@kernel.org>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-ID: <20250124234623.3609069-1-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 6f61269 commit 43fb96a
1 file changed
+26
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7120 | 7120 | | |
7121 | 7121 | | |
7122 | 7122 | | |
| 7123 | + | |
| 7124 | + | |
| 7125 | + | |
| 7126 | + | |
| 7127 | + | |
| 7128 | + | |
| 7129 | + | |
| 7130 | + | |
| 7131 | + | |
| 7132 | + | |
| 7133 | + | |
| 7134 | + | |
| 7135 | + | |
7123 | 7136 | | |
7124 | 7137 | | |
7125 | 7138 | | |
| |||
7180 | 7193 | | |
7181 | 7194 | | |
7182 | 7195 | | |
7183 | | - | |
| 7196 | + | |
7184 | 7197 | | |
7185 | 7198 | | |
7186 | 7199 | | |
| |||
7315 | 7328 | | |
7316 | 7329 | | |
7317 | 7330 | | |
7318 | | - | |
| 7331 | + | |
7319 | 7332 | | |
7320 | 7333 | | |
7321 | 7334 | | |
| |||
7451 | 7464 | | |
7452 | 7465 | | |
7453 | 7466 | | |
| 7467 | + | |
7454 | 7468 | | |
7455 | 7469 | | |
7456 | | - | |
7457 | | - | |
7458 | | - | |
| 7470 | + | |
| 7471 | + | |
| 7472 | + | |
7459 | 7473 | | |
7460 | | - | |
7461 | | - | |
| 7474 | + | |
| 7475 | + | |
| 7476 | + | |
| 7477 | + | |
| 7478 | + | |
| 7479 | + | |
| 7480 | + | |
7462 | 7481 | | |
7463 | 7482 | | |
7464 | 7483 | | |
| |||
0 commit comments