diff options
author | Svetlana Parfenova <svetlana.parfenova@syntacore.com> | 2025-09-01 20:53:50 +0700 |
---|---|---|
committer | Kees Cook <kees@kernel.org> | 2025-09-03 20:49:32 -0700 |
commit | 8c94db0ae97c72c253a615f990bd466b456e94f6 (patch) | |
tree | 6314c271d881ad51b48e1169de596a74bd9d64e1 /scripts/generate_rust_analyzer.py | |
parent | a728ce8ffbd27954fdb2826dcc15a6576e574b83 (diff) |
binfmt_elf: preserve original ELF e_flags for core dumps
Some architectures, such as RISC-V, use the ELF e_flags field to encode
ABI-specific information (e.g., ISA extensions, fpu support). Debuggers
like GDB rely on these flags in core dumps to correctly interpret
optional register sets. If the flags are missing or incorrect, GDB may
warn and ignore valid data, for example:
warning: Unexpected size of section '.reg2/213' in core file.
This can prevent access to fpu or other architecture-specific registers
even when they were dumped.
Save the e_flags field during ELF binary loading (in load_elf_binary())
into the mm_struct, and later retrieve it during core dump generation
(in fill_note_info()). Kconfig option CONFIG_ARCH_HAS_ELF_CORE_EFLAGS
is introduced for architectures that require this behaviour.
Signed-off-by: Svetlana Parfenova <svetlana.parfenova@syntacore.com>
Link: https://lore.kernel.org/r/20250901135350.619485-1-svetlana.parfenova@syntacore.com
Signed-off-by: Kees Cook <kees@kernel.org>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions