diff options
author | Kees Cook <kees@kernel.org> | 2025-02-19 11:53:16 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-03-13 13:07:52 +0100 |
commit | f13a5281a3364d235974c31568c5d1c501b2109e (patch) | |
tree | 8852525510936dea34ec091dbe1e7127fbbac5dd /Documentation | |
parent | eb0695d87a81e7c1f0509b7d8ee7c65fbc26aec9 (diff) | |
download | linux-f13a5281a3364d235974c31568c5d1c501b2109e.tar.gz linux-f13a5281a3364d235974c31568c5d1c501b2109e.tar.bz2 linux-f13a5281a3364d235974c31568c5d1c501b2109e.zip |
coredump: Only sort VMAs when core_sort_vma sysctl is set
[ Upstream commit 39ec9eaaa165d297d008d1fa385748430bd18e4d ]
The sorting of VMAs by size in commit 7d442a33bfe8 ("binfmt_elf: Dump
smaller VMAs first in ELF cores") breaks elfutils[1]. Instead, sort
based on the setting of the new sysctl, core_sort_vma, which defaults
to 0, no sorting.
Reported-by: Michael Stapelberg <michael@stapelberg.ch>
Closes: https://lore.kernel.org/all/20250218085407.61126-1-michael@stapelberg.de/ [1]
Fixes: 7d442a33bfe8 ("binfmt_elf: Dump smaller VMAs first in ELF cores")
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/admin-guide/sysctl/kernel.rst | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Documentation/admin-guide/sysctl/kernel.rst b/Documentation/admin-guide/sysctl/kernel.rst index b2b36d0c3094..7a85b6eb884e 100644 --- a/Documentation/admin-guide/sysctl/kernel.rst +++ b/Documentation/admin-guide/sysctl/kernel.rst @@ -212,6 +212,17 @@ pid>/``). This value defaults to 0. +core_sort_vma +============= + +The default coredump writes VMAs in address order. By setting +``core_sort_vma`` to 1, VMAs will be written from smallest size +to largest size. This is known to break at least elfutils, but +can be handy when dealing with very large (and truncated) +coredumps where the more useful debugging details are included +in the smaller VMAs. + + core_uses_pid ============= |