summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChang S. Bae <chang.seok.bae@intel.com>2023-02-28 00:05:03 +0300
committerDave Hansen <dave.hansen@linux.intel.com>2023-03-22 20:59:13 +0300
commitb15888840207c2bfe678dd1f68a32db54315e71f (patch)
tree471508fc32ba4580b475a68cc84d40edee9e9bd1 /tools
parenta3f547addcaa10df5a226526bc9e2d9a94542344 (diff)
downloadlinux-b15888840207c2bfe678dd1f68a32db54315e71f.tar.xz
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: 2308ee57d93d ("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
Diffstat (limited to 'tools')
0 files changed, 0 insertions, 0 deletions