Project

General

Profile

Actions

Bug #14004

closed

kernel core dumps never set EI_VERSION

Added by Robert Mustacchi 6 months ago. Updated 6 months ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

While trying to use the rust-based Gimli tool to perform a dwarfdump to test #13925, I found that one of the tools reported an unsupported ELF header. This was suspicious because when I used a gcore of it, it worked fine and other tools like mdb, readelf, etc. were all happy with this. So digging into and checking the source code of the underlying object crate that was driving it, they were refusing to operate on a file whose e_ident[EI_VERSION] was not EV_CURRENT. A quite reasonable thing to do.

It turns out that kernel initiated core dumps set e_version to EV_CURRENT, but never touch the e_ident variant. libproc does actually set both. In this case, the kernel is wrong and if there's any doubt, even the linkers and libraries guide makes a point that this should be set. Thankfully the fix is simple and when editing the file with mdb, it proved that it worked correctly.

Actions

Also available in: Atom PDF