]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
cgroups/devices: correctly verify bpf device useability in cgfsng_devices_activate()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 4 Dec 2019 13:03:48 +0000 (14:03 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 5 Dec 2019 10:00:13 +0000 (11:00 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c

index f2223afc6ee123d52b28b06cd32272791fdc8444..fdf0451a15b8e18f4b6ec937811909d0f8ff29d8 100644 (file)
@@ -2749,10 +2749,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);