Commit f67ce83
KVM: x86/mmu: Ensure NX huge page recovery thread is alive before waking
commit 43fb96a upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2b3928b7c896e5a9fb6b1373924adafe8e01a0c6)
Signed-off-by: Jack Vogel <jack.vogel@oracle.com>1 parent a95ae3c commit f67ce83
1 file changed
+26
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7229 | 7229 | | |
7230 | 7230 | | |
7231 | 7231 | | |
| 7232 | + | |
| 7233 | + | |
| 7234 | + | |
| 7235 | + | |
| 7236 | + | |
| 7237 | + | |
| 7238 | + | |
| 7239 | + | |
| 7240 | + | |
| 7241 | + | |
| 7242 | + | |
| 7243 | + | |
| 7244 | + | |
7232 | 7245 | | |
7233 | 7246 | | |
7234 | 7247 | | |
| |||
7289 | 7302 | | |
7290 | 7303 | | |
7291 | 7304 | | |
7292 | | - | |
| 7305 | + | |
7293 | 7306 | | |
7294 | 7307 | | |
7295 | 7308 | | |
| |||
7435 | 7448 | | |
7436 | 7449 | | |
7437 | 7450 | | |
7438 | | - | |
| 7451 | + | |
7439 | 7452 | | |
7440 | 7453 | | |
7441 | 7454 | | |
| |||
7571 | 7584 | | |
7572 | 7585 | | |
7573 | 7586 | | |
| 7587 | + | |
7574 | 7588 | | |
7575 | 7589 | | |
7576 | | - | |
7577 | | - | |
7578 | | - | |
| 7590 | + | |
| 7591 | + | |
| 7592 | + | |
7579 | 7593 | | |
7580 | | - | |
7581 | | - | |
| 7594 | + | |
| 7595 | + | |
| 7596 | + | |
| 7597 | + | |
| 7598 | + | |
| 7599 | + | |
| 7600 | + | |
7582 | 7601 | | |
7583 | 7602 | | |
7584 | 7603 | | |
| |||
0 commit comments