Skip to content

Switch coredump ELF parsing to fork+dlopen#21580

Merged
keszybz merged 12 commits intosystemd:mainfrom
bluca:core_fork
Nov 30, 2021
Merged

Switch coredump ELF parsing to fork+dlopen#21580
keszybz merged 12 commits intosystemd:mainfrom
bluca:core_fork

Conversation

@bluca
Copy link
Copy Markdown
Member

@bluca bluca commented Nov 30, 2021

Split out from #21454 without the new systemd-analyze command

bluca added 12 commits November 30, 2021 16:49
Note that c.f needs to be closed _before_ taking or freeing
the buf pointer, as it might be invalidated
Parsing objects is risky as data could be malformed or malicious,
so avoid doing that from the main systemd-coredump process and
instead fork another process, and set it to avoid generating
core files itself.
Allow later usage when we only want to fetch the JSON packaging metadata
systemd-pstore does not use any symbol from libdw, and never did,
but the dependency was listed since the beginning
In order to avoid inflating the dependency list for the core
library, use dlopen when inspecting elfs, since it's only
used in two non-core executables.
@keszybz
Copy link
Copy Markdown
Member

keszybz commented Nov 30, 2021

LGTM.

@keszybz keszybz added the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Nov 30, 2021
@github-actions github-actions bot added the units label Nov 30, 2021
@keszybz keszybz merged commit 4248b9f into systemd:main Nov 30, 2021
@bluca bluca deleted the core_fork branch November 30, 2021 20:53
@keszybz keszybz removed the good-to-merge/waiting-for-ci 👍 PR is good to merge, but CI hasn't passed at time of review. Please merge if you see CI has passed label Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants