target/i386: Always completely initialize TranslateFault
commit8218c048be1567db9dfd3cf1e19fbff76bce8cfd
authorRichard Henderson <richard.henderson@linaro.org>
Thu, 1 Dec 2022 07:45:22 +0000 (30 23:45 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 1 Dec 2022 08:53:24 +0000 (1 09:53 +0100)
treeec48a710457947bdec939b85cb449d3be7571d5f
parent38e65936a8df1c9e7f5d19eae38a42133fab844b
target/i386: Always completely initialize TranslateFault

In get_physical_address, the canonical address check failed to
set TranslateFault.stage2, which resulted in an uninitialized
read from the struct when reporting the fault in x86_cpu_tlb_fill.

Adjust all error paths to use structure assignment so that the
entire struct is always initialized.

Reported-by: Daniel Hoffman <dhoff749@gmail.com>
Fixes: 9bbcf372193a ("target/i386: Reorg GET_HPHYS")
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20221201074522.178498-1-richard.henderson@linaro.org>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1324
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/tcg/sysemu/excp_helper.c