1 From 8d3cea620ab661897fb485ece7332a9073c1783d Mon Sep 17 00:00:00 2001
2 From: Lennart Poettering <lennart@poettering.net>
3 Date: Wed, 13 Feb 2019 16:51:22 +0100
4 Subject: [PATCH 3/3] sd-bus: if we receive an invalid dbus message, ignore and
7 dbus-daemon might have a slightly different idea of what a valid msg is
8 than us (for example regarding valid msg and field sizes). Let's hence
9 try to proceed if we can and thus drop messages rather than fail the
10 connection if we fail to validate a message.
12 Hopefully the differences in what is considered valid are not visible
13 for real-life usecases, but are specific to exploit attempts only.
15 src/libsystemd/sd-bus/bus-socket.c | 9 ++++++---
16 1 file changed, 6 insertions(+), 3 deletions(-)
18 diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
19 index 30d6455b6f..441b4a816f 100644
20 --- a/src/libsystemd/sd-bus/bus-socket.c
21 +++ b/src/libsystemd/sd-bus/bus-socket.c
22 @@ -1072,7 +1072,7 @@ static int bus_socket_read_message_need(sd_bus *bus, size_t *need) {
25 static int bus_socket_make_message(sd_bus *bus, size_t size) {
27 + sd_bus_message *t = NULL;
31 @@ -1097,7 +1097,9 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) {
37 + log_debug_errno(r, "Received invalid message from connection %s, dropping.", strna(bus->description));
42 @@ -1108,7 +1110,8 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) {
46 - bus->rqueue[bus->rqueue_size++] = t;
48 + bus->rqueue[bus->rqueue_size++] = t;