linux/arch/x86
Chang S. Bae b158888402 x86/fpu/xstate: Prevent false-positive warning in __copy_xstate_uabi_buf()
__copy_xstate_to_uabi_buf() copies either from the tasks XSAVE buffer
or from init_fpstate into the ptrace buffer. Dynamic features, like
XTILEDATA, have an all zeroes init state and are not saved in
init_fpstate, which means the corresponding bit is not set in the
xfeatures bitmap of the init_fpstate header.

But __copy_xstate_to_uabi_buf() retrieves addresses for both the tasks
xstate and init_fpstate unconditionally via __raw_xsave_addr().

So if the tasks XSAVE buffer has a dynamic feature set, then the
address retrieval for init_fpstate triggers the warning in
__raw_xsave_addr() which checks the feature bit in the init_fpstate
header.

Remove the address retrieval from init_fpstate for extended features.
They have an all zeroes init state so init_fpstate has zeros for them.
Then zeroing the user buffer for the init state is the same as copying
them from init_fpstate.

Fixes: 2308ee57d9 ("x86/fpu/amx: Enable the AMX feature in 64-bit mode")
Reported-by: Mingwei Zhang <mizhang@google.com>
Link: https://lore.kernel.org/kvm/20230221163655.920289-2-mizhang@google.com/
Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Tested-by: Mingwei Zhang <mizhang@google.com>
Link: https://lore.kernel.org/all/20230227210504.18520-2-chang.seok.bae%40intel.com
Cc: stable@vger.kernel.org
2023-03-22 10:59:13 -07:00
..
boot Kbuild updates for v6.3 2023-02-26 11:53:25 -08:00
coco - Fixup comment typo 2023-02-25 09:11:30 -08:00
configs x86/defconfig: Enable CONFIG_DEBUG_WX=y 2022-09-02 10:41:42 +02:00
crypto crypto: x86/aria-avx - Do not use avx2 instructions 2023-02-14 13:39:33 +08:00
entry Changes in this cycle were: 2023-03-02 09:45:34 -08:00
events ARM: 2023-02-25 11:30:21 -08:00
hyperv x86/hyperv: Remove unregister syscore call from Hyper-V cleanup 2022-11-29 17:55:29 +00:00
ia32 x86/signal/32: Merge native and compat 32-bit signal code 2022-10-19 09:58:49 +02:00
include virt/coco/sev-guest: Add throttling awareness 2023-03-13 13:29:27 +01:00
kernel x86/fpu/xstate: Prevent false-positive warning in __copy_xstate_uabi_buf() 2023-03-22 10:59:13 -07:00
kvm ARM: 2023-02-25 11:30:21 -08:00
lib - Cache the AMD debug registers in per-CPU variables to avoid MSR writes 2023-02-21 14:51:40 -08:00
math-emu
mm x86/mm: Do not shuffle CPU entry areas without KASLR 2023-03-22 10:42:47 -07:00
net bpf, x86: Simplify the parsing logic of structure parameters 2023-01-10 15:53:22 -08:00
pci x86/pci/xen: Fixup fallout from the PCI/MSI overhaul 2023-01-16 20:40:44 +01:00
platform A healthy mix of EFI contributions this time: 2023-02-23 14:41:48 -08:00
power - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
purgatory x86/purgatory: disable KMSAN instrumentation 2022-10-28 13:37:23 -07:00
ras
realmode x86/boot: Skip realmode init code when running as Xen PV guest 2022-11-25 12:05:22 +01:00
tools kbuild: allow to combine multiple V= levels 2023-01-22 23:43:32 +09:00
um This pull request contains the following changes for UML: 2023-03-01 09:13:00 -08:00
video
virt/vmx/tdx
xen xen: branch for v6.3-rc1 2023-02-21 17:07:39 -08:00
.gitignore
Kbuild
Kconfig x86/Kconfig: Fix spellos & punctuation 2023-01-25 12:21:04 +01:00
Kconfig.assembler crypto: x86/aria-avx - fix build failure with old binutils 2023-01-20 18:29:31 +08:00
Kconfig.cpu
Kconfig.debug
Makefile x86/build: Make 64-bit defconfig the default 2023-02-15 14:20:17 +01:00
Makefile_32.cpu
Makefile.um This pull request contains the following changes for UML: 2023-03-01 09:13:00 -08:00