summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-21 03:52:39 +0100
committerLennart Poettering <lennart@poettering.net>2013-12-21 03:52:39 +0100
commit3547329642fef7468548320131ab992517957e81 (patch)
tree73b2b7885e865ad935c7f6b6dcf042c59c2c3cb2
parentbd746b8b0ce91be3f28532d319ffa577590f52d8 (diff)
bus: refuse messages pretending to originate from local interface
-rw-r--r--src/libsystemd-bus/bus-message.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index d6888738e1..b0f4b16d41 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -5133,6 +5133,14 @@ int bus_message_parse_fields(sd_bus_message *m) {
break;
}
+ /* Refuse non-local messages that claim they are local */
+ if (streq_ptr(m->path, "/org/freedesktop/DBus/Local"))
+ return -EBADMSG;
+ if (streq_ptr(m->interface, "org.freedesktop.DBus.Local"))
+ return -EBADMSG;
+ if (streq_ptr(m->sender, "org.freedesktop.DBus.Local"))
+ return -EBADMSG;
+
m->root_container.end = BUS_MESSAGE_BODY_SIZE(m);
if (BUS_MESSAGE_IS_GVARIANT(m)) {