summaryrefslogtreecommitdiffstats
path: root/src/core/dbus-manager.c
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2024-04-28 19:42:51 +0200
committerLuca Boccassi <luca.boccassi@gmail.com>2024-04-29 14:14:40 +0200
commitba4c69a0c6fafe7eb29988dc1fe0e30ecacad87f (patch)
treedcb21f78388bbec86b7fd4e3fae2a0525e800f4a /src/core/dbus-manager.c
parentMerge pull request #32556 from YHNdnzj/development-freeze (diff)
downloadsystemd-ba4c69a0c6fafe7eb29988dc1fe0e30ecacad87f.tar.xz
systemd-ba4c69a0c6fafe7eb29988dc1fe0e30ecacad87f.zip
core: Pass NULL error in dump_impl()
If mac_selinux_access_check() or bus_verify_bypass_dump_ratelimit_async() fail, we goto "ratelimited" where we set a custom D-BUS error. In "ratelimited", we call sd_bus_error_setf() which eventually hits an assert_return(!bus_error_is_dirty()). Avoid hitting this assertion by passing NULL as the error to mac_selinux_access_check() and bus_verify_bypass_dump_ratelimit_async() since we will override the error immediately anyway if either fails. We modify both functions as well to allow passing a NULL error and fix the argument name as well while we're at it.
Diffstat (limited to 'src/core/dbus-manager.c')
-rw-r--r--src/core/dbus-manager.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/dbus-manager.c b/src/core/dbus-manager.c
index 7a969ce6c1..70aecc8ede 100644
--- a/src/core/dbus-manager.c
+++ b/src/core/dbus-manager.c
@@ -1405,11 +1405,11 @@ static int dump_impl(
* operations, and can cause PID1 to stall. So it seems similar enough in terms of security
* considerations and impact, and thus use the same access check for dumps which, given the
* large amount of data to fetch, can stall PID1 for quite some time. */
- r = mac_selinux_access_check(message, "reload", error);
+ r = mac_selinux_access_check(message, "reload", /* error = */ NULL);
if (r < 0)
goto ratelimited;
- r = bus_verify_bypass_dump_ratelimit_async(m, message, error);
+ r = bus_verify_bypass_dump_ratelimit_async(m, message, /* error = */ NULL);
if (r < 0)
goto ratelimited;
if (r == 0)