]> git.proxmox.com Git - mirror_lxc.git/commit
cgroups: handle older kernels (e.g. v4.9)
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 30 Mar 2020 15:40:16 +0000 (17:40 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 30 Mar 2020 16:17:41 +0000 (18:17 +0200)
commitd1783ef4d0fb1c6e1e9ab9876c46bb6814da4d18
tree0fd8720a27abcdccc2765ad6f0c2c6114a6d0d90
parent6821739c3c2db7d5ac94d2c30bf19511241db5d2
cgroups: handle older kernels (e.g. v4.9)

On olders kernels the restrictions to move processes between cgroups are
different than they are on newer kernels. Specifically, we're running into the
following check:

if (!uid_eq(cred->euid, GLOBAL_ROOT_UID) &&
    !uid_eq(cred->euid, tcred->uid) &&
    !uid_eq(cred->euid, tcred->suid))
        ret = -EACCES;

which dictates that in order to move a process into a cgroup one either needs
to be global root (no restrictions apply) or the effective uid of the process
trying to move the process and the {saved}uid of the process that is supposed
to be moved need to be identical. The new attaching logic we did didn't
fulfill this criterion for because it's not present on new kernels.

Closes https://github.com/lxc/lxd/issues/7104.
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cgroups/cgfsng.c
src/lxc/conf.c
src/lxc/conf.h