From 9994db5125538bcabca9239f132280b46fa266c7 Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Wed, 4 Dec 2019 14:03:48 +0100 Subject: [PATCH] cgroups/devices: correctly verify bpf device useability in cgfsng_devices_activate() Signed-off-by: Christian Brauner --- src/lxc/cgroups/cgfsng.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lxc/cgroups/cgfsng.c b/src/lxc/cgroups/cgfsng.c index 35763c8ce..5d32c493e 100644 --- a/src/lxc/cgroups/cgfsng.c +++ b/src/lxc/cgroups/cgfsng.c @@ -2771,10 +2771,8 @@ __cgfsng_ops bool cgfsng_devices_activate(struct cgroup_ops *ops, struct lxc_list *it; struct bpf_program *devices_old; - if (!unified) - return false; - - if (lxc_list_empty(&conf->devices)) + if (!unified || !unified->bpf_device_controller || + !unified->container_full_path || lxc_list_empty(&conf->devices)) return true; devices = bpf_program_new(BPF_PROG_TYPE_CGROUP_DEVICE); -- 2.47.2