KVM: x86: Fix misplaced backport of "work around leak of uninitialized stack contents"
authorGuillaume Bertholon <guillaume.bertholon@ens.fr>
Tue, 1 Feb 2022 17:17:51 +0000 (18:17 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 3 Feb 2022 08:27:54 +0000 (09:27 +0100)
commit52060aa13c85ef1acb53f0498bfcdf22e129ef51
treedccb696762006c46ccfb20117eec5af6857e676a
parent1fa3bfc12bebafed63f992ed206ae434c1736f0d
KVM: x86: Fix misplaced backport of "work around leak of uninitialized stack contents"

The upstream commit 541ab2aeb282 ("KVM: x86: work around leak of
uninitialized stack contents") resets `exception` in the function
`kvm_write_guest_virt_system`.
However, its backported version in stable (commit ba7f1c934f2e
("KVM: x86: work around leak of uninitialized stack contents")) applied
the change in `emulator_write_std` instead.

This patch moves the memset instruction back to
`kvm_write_guest_virt_system`.

Fixes: ba7f1c934f2e ("KVM: x86: work around leak of uninitialized stack contents")
Signed-off-by: Guillaume Bertholon <guillaume.bertholon@ens.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kvm/x86.c