mirror-linux/arch/x86/kernel/fpu
Yongxin Liu c8161e5304 x86/fpu: Fix FPU state core dump truncation on CPUs with no extended xfeatures
Zero can be a valid value of num_records. For example, on Intel Atom x6425RE,
only x87 and SSE are supported (features 0, 1), and fpu_user_cfg.max_features
is 3. The for_each_extended_xfeature() loop only iterates feature 2, which is
not enabled, so num_records = 0. This is valid and should not cause core dump
failure.

The issue is that dump_xsave_layout_desc() returns 0 for both genuine errors
(dump_emit() failure) and valid cases (no extended features). Use negative
return values for errors and only abort on genuine failures.

Fixes: ba386777a3 ("x86/elf: Add a new FPU buffer layout info to x86 core files")
Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://patch.msgid.link/20251210000219.4094353-2-yongxin.liu@windriver.com
2025-12-10 08:44:34 +01:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
bugs.c x86/msr: Prepare for including <linux/percpu.h> into <asm/msr.h> 2024-03-04 12:01:39 +01:00
context.h x86/fpu: Convert task_struct::thread.fpu accesses to use x86_task_fpu() 2025-04-14 08:18:29 +02:00
core.c x86: Restrict KVM-induced symbol exports to KVM modules where obvious/possible 2025-11-12 15:29:38 -08:00
init.c x86/fpu/xstate: Differentiate default features for host and guest FPUs 2025-06-24 13:46:32 -07:00
internal.h x86/fpu: Fully optimize out WARN_ON_FPU() 2025-02-10 14:45:59 -08:00
legacy.h x86/fpu: Remove .fixup usage 2021-12-11 09:09:48 +01:00
regset.c x86/fpu: Convert task_struct::thread.fpu accesses to use x86_task_fpu() 2025-04-14 08:18:29 +02:00
signal.c x86/fpu: Refactor xfeature bitmask update code for sigframe XSAVE 2025-04-16 10:01:00 +02:00
xstate.c x86/fpu: Fix FPU state core dump truncation on CPUs with no extended xfeatures 2025-12-10 08:44:34 +01:00
xstate.h Merge branch 'x86/msr' into x86/core, to resolve conflicts 2025-05-13 10:42:06 +02:00