summaryrefslogtreecommitdiff
path: root/dbus/dbus-spawn.c
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-02-21 16:00:42 +0000
committerSimon McVittie <smcv@collabora.com>2022-02-25 14:57:18 +0000
commite7a4123d6e4096a22a6b32f9a84747ab95590577 (patch)
tree8f05012895fe0b776b9bc583a5b5533b24d6e1cf /dbus/dbus-spawn.c
parent4ed9f00a7cbff498f74b7c5f4861280a50497c20 (diff)
downloaddbus-e7a4123d6e4096a22a6b32f9a84747ab95590577.tar.gz
dbus-daemon-launch-helper: Reset Linux OOM score adjustment here
Previously, we were relying on the system bus being able to reset its OOM score adjustment after it forks, but before it execs the dbus-daemon-launch-helper. However, it can't actually do that (leading to dbus#378), because the system bus typically starts as root, uses its root privileges to adjust resource limits, and then drops privileges to the `@DBUS_USER@`, typically `dbus` or `messagebus`. This leaves the pseudo-files in /proc for its process parameters owned by root, and the `@DBUS_USER@` is not allowed to open them for writing. The dbus-daemon-launch-helper is setuid root, so it can certainly alter its OOM score adjustment before exec'ing the actual activated service. We need to do this before dropping privileges, because after dropping privileges we would be unable to write to this process parameter. This is a non-async-signal-safe context, so we can safely log errors here, unlike the fork-and-exec code paths. Resolves: https://gitlab.freedesktop.org/dbus/dbus/-/issues/378 Signed-off-by: Simon McVittie <smcv@collabora.com> (cherry picked from commit 2efb462466d628d47d7f80c5a8e864a62b6154cc)
Diffstat (limited to 'dbus/dbus-spawn.c')
0 files changed, 0 insertions, 0 deletions