linux-stable/arch
Greg Kroah-Hartman 9f95a161a7 kvm: initialize all of the kvm_debugregs structure before sending it to userspace
commit 2c10b61421 upstream.

When calling the KVM_GET_DEBUGREGS ioctl, on some configurations, there
might be some unitialized portions of the kvm_debugregs structure that
could be copied to userspace.  Prevent this as is done in the other kvm
ioctls, by setting the whole structure to 0 before copying anything into
it.

Bonus is that this reduces the lines of code as the explicit flag
setting and reserved space zeroing out can be removed.

Cc: Sean Christopherson <seanjc@google.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: <x86@kernel.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: stable <stable@kernel.org>
Reported-by: Xingyuan Mo <hdthky0@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Message-Id: <20230214103304.3689213-1-gregkh@linuxfoundation.org>
Tested-by: Xingyuan Mo <hdthky0@gmail.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-02-22 12:50:41 +01:00
..
alpha exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
arc arc: iounmap() arg is volatile 2022-11-03 23:56:54 +09:00
arm exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
arm64 arm64: dts: meson-axg: Make mmc host controller interrupts level-sensitive 2023-02-22 12:50:33 +01:00
c6x
csky csky: Fix function name in csky_alignment() and die() 2023-02-06 07:52:49 +01:00
h8300 h8300: Fix build errors from do_exit() to make_task_dead() transition 2023-02-06 07:52:49 +01:00
hexagon hexagon: Fix function name in die() 2023-02-06 07:52:49 +01:00
ia64 ia64: make IA64_MCA_RECOVERY bool instead of tristate 2023-02-06 07:52:49 +01:00
m68k exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
microblaze exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
mips exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
nds32 exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
nios2 exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
openrisc exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
parisc parisc: Wire up PTRACE_GETREGS/PTRACE_SETREGS for compat case 2023-02-22 12:50:28 +01:00
powerpc powerpc/imc-pmu: Revert nest_init_lock to being a mutex 2023-02-22 12:50:29 +01:00
riscv riscv: Fixup race condition on PG_dcache_clean in flush_icache_pte 2023-02-22 12:50:33 +01:00
s390 s390/decompressor: specify __decompress() buf len to avoid overflow 2023-02-22 12:50:34 +01:00
sh exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
sparc exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
um UM: cpuinfo: Fix a warning for CONFIG_CPUMASK_OFFSTACK 2022-10-26 13:22:16 +02:00
unicore32
x86 kvm: initialize all of the kvm_debugregs structure before sending it to userspace 2023-02-22 12:50:41 +01:00
xtensa exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
.gitignore
Kconfig locking/refcount: Consolidate implementations of refcount_t 2022-07-29 17:14:17 +02:00