linux-stable/arch/x86
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
..
boot x86/boot: Avoid using Intel mnemonics in AT&T syntax asm 2023-01-18 11:42:03 +01:00
configs vgacon: remove software scrollback support 2020-09-17 13:47:54 +02:00
crypto crypto: x86/chacha20 - Avoid spurious jumps to other functions 2022-05-25 09:14:32 +02:00
entry exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
events perf/x86/amd: fix potential integer overflow on shift of a int 2023-02-06 07:52:47 +01:00
hyperv x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails 2021-11-26 10:47:21 +01:00
ia32 binfmt: Move install_exec_creds after setup_new_exec to match binfmt_elf 2023-01-18 11:41:46 +01:00
include KVM: VMX: Fix the spelling of CPU_BASED_USE_TSC_OFFSETTING 2023-01-18 11:41:54 +01:00
kernel exit: Add and use make_task_dead. 2023-02-06 07:52:49 +01:00
kvm kvm: initialize all of the kvm_debugregs structure before sending it to userspace 2023-02-22 12:50:41 +01:00
lib x86/asm: Fix an assembler warning with current binutils 2023-02-06 07:52:48 +01:00
math-emu x86: math-emu: Fix up 'cmp' insn for clang ias 2020-07-29 10:18:40 +02:00
mm x86/ioremap: Fix page aligned size calculation in __ioremap_caller() 2022-12-08 11:23:06 +01:00
net bpf: Introduce BPF nospec instruction for mitigating Spectre v4 2021-09-15 09:47:38 +02:00
oprofile
pci x86/pci/xen: Disable PCI/MSI[-X] masking for XEN_HVM guests 2022-06-06 08:33:48 +02:00
platform x86/olpc: fix 'logical not is only applied to the left hand side' 2022-08-25 11:18:10 +02:00
power x86/pm: Add enumeration check before spec MSRs save/restore setup 2022-12-08 11:23:05 +01:00
purgatory x86/purgatory: Disable various profiling and sanitizing options 2020-06-24 17:50:20 +02:00
ras
realmode x86/mm: Flush global TLB when switching to trampoline page-table 2022-01-27 09:19:42 +01:00
tools x86/tools: Fix objdump version check again 2021-08-18 08:57:01 +02:00
um arch: um: Mark the stack non-executable to fix a binutils warning 2022-10-15 07:54:38 +02:00
video
xen x86/xen: Fix memory leak in xen_init_lock_cpu() 2023-01-18 11:40:57 +01:00
.gitignore
Kbuild
Kconfig locking/refcount: Consolidate implementations of refcount_t 2022-07-29 17:14:17 +02:00
Kconfig.cpu
Kconfig.debug x86, perf: Fix the dependency of the x86 insn decoder selftest 2019-09-02 20:05:58 +02:00
Makefile x86/build: Propagate $(CLANG_FLAGS) to $(REALMODE_FLAGS) 2021-05-11 14:04:06 +02:00
Makefile.um
Makefile_32.cpu