From 06820eafdbc3dd89cb1f7563564c7d91426709ca Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 15 Nov 2015 22:00:47 +0100 Subject: machined,logind: be more careful when accepting PIDs and UIDs from clients Always validate first before we start processing the data. --- src/machine/machined-dbus.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/machine') diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c index 7827f063c1..4ec6baaa1f 100644 --- a/src/machine/machined-dbus.c +++ b/src/machine/machined-dbus.c @@ -199,6 +199,9 @@ static int method_get_machine_by_pid(sd_bus_message *message, void *userdata, sd if (r < 0) return r; + if (pid < 0) + return -EINVAL; + if (pid == 0) { _cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL; -- cgit v1.2.3-54-g00ecf