Bug #14242
closedprograms that lack PT_PHDR are not properly loaded
100%
Description
This is an upstream of https://smartos.org/bugview/OS-4128 from illumos-joyent
Without this, malicious, broken or fuzzed ELF binaries can be misinterpreted and lead to excessive kernel memory consumption.
From the original Joyent ticket:
Apparently, on some conditions (yet to be determined), Linux (or Ubuntu 14.10 or some version of gcc or something else in the toolchain) will generate a binary that lacks the PT_PHDR program header. According to ELF, this is an optional program header, but our binaries have always had it. When this program header is not found, the system annoyingly stops further loading but otherwise returns success -- practically fating the program to die a horrible death in the linker. These binaries are peculiar but they aren't corrupt; we should be able to accommodate them.
Related issues
Updated by Andy Fiddaman over 1 year ago
- Related to Bug #14236: signed math leads getelfshdr astray added
Updated by Electric Monk 9 months ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit 4e18e297380f99d39327599157792494d044942a
commit 4e18e297380f99d39327599157792494d044942a Author: Patrick Mooney <pmooney@pfmooney.com> Date: 2022-09-13T19:40:22.000Z 14236 signed math leads getelfshdr astray 14242 programs that lack PT_PHDR are not properly loaded Portions contributed by: Bryan Cantrill <bryan@joyent.com> Portions contributed by: Andy Fiddaman <illumos@fiddaman.net> Reviewed by: Robert Mustacchi <rm+illumos@fingolfin.org> Reviewed by: Patrick Mooney <pmooney@pfmooney.com> Reviewed by: Andy Fiddaman <illumos@fiddaman.net> Approved by: Rich Lowe <richlowe@richlowe.net>