Commit 7d442a3
binfmt_elf: Dump smaller VMAs first in ELF cores
Large cores may be truncated in some scenarios, such as with daemons
with stop timeouts that are not large enough or lack of disk space. This
impacts debuggability with large core dumps since critical information
necessary to form a usable backtrace, such as stacks and shared library
information, are omitted.
We attempted to figure out which VMAs are needed to create a useful
backtrace, and it turned out to be a non-trivial problem. Instead, we
try simply sorting the VMAs by size, which has the intended effect.
By sorting VMAs by dump size and dumping in that order, we have a
simple, yet effective heuristic.
Signed-off-by: Brian Mak <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Acked-by: "Eric W. Biederman" <[email protected]>
Signed-off-by: Kees Cook <[email protected]>1 parent fb97d2e commit 7d442a3
1 file changed
+16
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
1249 | 1250 | | |
1250 | 1251 | | |
1251 | 1252 | | |
| 1253 | + | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1252 | 1265 | | |
1253 | 1266 | | |
1254 | 1267 | | |
| |||
1311 | 1324 | | |
1312 | 1325 | | |
1313 | 1326 | | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
1314 | 1330 | | |
1315 | 1331 | | |
0 commit comments