accel: Fix NULL deref in NVMM / WHPX vCPU init
cover accel: Fix NULL deref in NVMM / WHPX vCPU init
Fix recently introduced NULL deref in NVMM/WHPX
vCPU init() handlers.
Philippe Mathieu-Daudé (2):
accel/whpx: Fix NULL dereference in whpx_init_vcpu() accel/nvmm: Fix NULL dereference in nvmm_init_vcpu()
target/i386/nvmm/nvmm-all.c | 2 +- target/i386/whpx/whpx-all.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.41.0
PATCH 1/2 accel/whpx: Fix NULL dereference in whpx_init_vcpu()
When mechanically moving the @dirty field to AccelCPUState in commit 9ad49538c7, we neglected cpu->accel is still NULL when we want to dereference it.
--- target/i386/whpx/whpx-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/whpx/whpx-all.c +1 -1
@@ -2236,7 +2236,7 @@ int whpx_init_vcpu(CPUState *cpu) } vcpu->interruptable = true; - cpu->accel->dirty = true; + vcpu->dirty = true; cpu->accel = vcpu; max_vcpu_index =max (max_vcpu_index, cpu->cpu_index);qemu_add_vm_change_state_handler (whpx_cpu_update_state, env);
Signature · 1 line
2.41.0
PATCH 2/2 accel/nvmm: Fix NULL dereference in nvmm_init_vcpu()
In reply to Philippe Mathieu-DaudéWhen mechanically moving the @dirty field to AccelCPUState in commit 79f1926b2d, we neglected cpu->accel is still NULL when we want to dereference it.
--- target/i386/nvmm/nvmm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/nvmm/nvmm-all.c +1 -1
@@ -982,7 +982,7 @@ nvmm_init_vcpu(CPUState *cpu) } } - cpu->accel->dirty = true; + qcpu->dirty = true; cpu->accel = qcpu;return 0 ;
Signature · 1 line
2.41.0
Quoted 3 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (2):
accel/whpx: Fix NULL dereference inwhpx_init_vcpu()accel/nvmm: Fix NULL dereference innvmm_init_vcpu()
r~