Hacker News new | ask | show | jobs
by pengaru 1283 days ago
It's not like it was ever a safe assumption to blindly dump core to a process' CWD. It was just a convenient option in a developer-centric UNIX mindset, in lieu of anything better.

Sometimes daemons run with a CWD changed somewhere rarely if ever written to at runtime, and presumed to primarily contain information intended for sharing. It's not hard to imagine a security-conscious daemon that's done both chroot() and chdir() into a path intended for publishing information out of, and not generally intended for the daemon to write into except by privileged users/publishers.

When that daemon spuriously dumps core into its CWD now you have potentially sensitive information sitting in the published tree, e.g. maybe the credentials of the privileged users are in that core file.

1 comments

I really don’t get why people are so quick to jump on “it changed so it’s bad.” systemd-coredump has to work in every possible case and is dealing with every unhappy path you can imagine. The kernel has a laundry list of situations where core files can’t be saved and systemd made the choice to set it up so some of the failure modes can’t happen.

If they just tried to write to cwd there would be a blogpost about “systemd loses coredumps if your app directory is read-only” which isn’t some theoretical problem, it’s containers.

There was no way to really win here.

> I really don’t get why people are so quick to jump on “it changed so it’s bad.”

That's not actually the issue here. Rather: "it changed so now it's inconsistent across platforms"

> There was no way to really win here.

There is:

- if you're changing a multi-platform standard, include the other platforms (e.g. create a coredumpctl tool for *BSD)

- do the changes slowly/incrementally in a backwards-compatible way (e.g. apply the new coredump locations first to read-only containers and service daemons running as systemd units)

- It's not a multi-platform standard more a happy accident of history.

- The BSD are irrelevant. Why hamper Linux development to cater for users who don't exist?

Forgetting about Aix, HP-UX,....?

It isn't as if it worked the same everywhere anyway.