]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
coredump: Only sort VMAs when core_sort_vma sysctl is set
authorKees Cook <kees@kernel.org>
Wed, 19 Feb 2025 19:53:16 +0000 (11:53 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 12:02:01 +0000 (13:02 +0100)
commit5481dee296f60d94f7b5317158a336f8d722d000
treee43db4343470d0826e77bd440257262651525def
parentdea6a349bcaf243fff95dfd0428a26be6a0fb44e
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>
Documentation/admin-guide/sysctl/kernel.rst
fs/coredump.c