target/i386: Fix CR2 handling for non-canonical addresses
Commit3563362ddf("target/i386: Introduce structures for mmu_translate") accidentally modified CR2 for non-canonical address exceptions while these should lead to a #GP / #SS instead -- without changing CR2. Fix that. A KUT test for this was submitted as [1]. [1] https://lore.kernel.org/kvm/20250612141637.131314-1-minipli@grsecurity.net/ Fixes:3563362ddf("target/i386: Introduce structures for mmu_translate") Signed-off-by: Mathias Krause <minipli@grsecurity.net> Link: https://lore.kernel.org/r/20250612142155.132175-1-minipli@grsecurity.net Cc: qemu-stable@nongnu.org Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
d8ec0baf4a
commit
df9a3372dd
1 changed files with 2 additions and 1 deletions
|
|
@ -592,7 +592,8 @@ static bool get_physical_address(CPUX86State *env, vaddr addr,
|
|||
if (sext != 0 && sext != -1) {
|
||||
*err = (TranslateFault){
|
||||
.exception_index = EXCP0D_GPF,
|
||||
.cr2 = addr,
|
||||
/* non-canonical #GP doesn't change CR2 */
|
||||
.cr2 = env->cr[2],
|
||||
};
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue