|
|
Subscribe / Log in / New account

Shuttleworth: Losing graciously

Shuttleworth: Losing graciously

Posted Feb 19, 2014 17:59 UTC (Wed) by HelloWorld (guest, #56129)
In reply to: Shuttleworth: Losing graciously by fandingo
Parent article: Shuttleworth: Losing graciously

> That's true if and only if that ancestor reaper never dies or is killed.
So what? systemd is already required to never die.


to post comments

Shuttleworth: Losing graciously

Posted Feb 19, 2014 18:29 UTC (Wed) by fandingo (guest, #67019) [Link]

If the reaper dies, then processes in that service escaped their "container" (because PPID is now 1). The service manager can no longer track them, and has lost all reliable control of the service.

This becomes a major problem with privileged services. Many services maintain a parent process that runs as root. Any compromise of this privileged service process (or malfeasance by it) allows it to kill it's hierarchy manager process and escape all control.

On the other hand, cgroups in a single-writer environment should be immune to this.

With systemd cgroup manager, PolKit would not authorize a process move outside all cgroups or to another cgroup (outside specific definitions like system.slice/sshd.service/ --> /user.slice/session.scope/).

The major benefit to systemd's cgroup manager is that it is not attackable via this style. It cannot be intentionally killed (it ignores all signals, even sigkill since it is PID 1), and if it were somehow forced to crash, the system would panic. Since PID 1 is the cgroup manager, there is no way to gain control of the kernel interface either.

There's no meaningful way to protect a reaper, unless you mandate that nothing in a hierarchy can run with enough privileges to kill the reaper. That would require a substantial change in many services, or requires additional sandboxing mechanisms in the kernel. (The kernel would need to perform a check that a caller of kill(2) is not trying to kill its reaper.)


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds