Smack: Handle CGROUP2 in the same way that CGROUP
authorJosé Bollo <jose.bollo@iot.bzh>
Tue, 27 Feb 2018 16:06:21 +0000 (17:06 +0100)
committerCasey Schaufler <casey@schaufler-ca.com>
Wed, 28 Feb 2018 17:27:12 +0000 (09:27 -0800)
The new file system CGROUP2 isn't actually handled
by smack. This changes makes Smack treat equally
CGROUP and CGROUP2 items.

Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Signed-off-by: Casey Schaufler <casey@schaufler-ca.com>
security/smack/smack_lsm.c

index 03fdecba93bb2b238d91e0e29efa0783c7e84b72..5d77ed04422c2168b64443d198cd0c32d95245db 100644 (file)
@@ -3431,6 +3431,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
        if (opt_dentry->d_parent == opt_dentry) {
                switch (sbp->s_magic) {
                case CGROUP_SUPER_MAGIC:
+               case CGROUP2_SUPER_MAGIC:
                        /*
                         * The cgroup filesystem is never mounted,
                         * so there's no opportunity to set the mount
@@ -3474,6 +3475,7 @@ static void smack_d_instantiate(struct dentry *opt_dentry, struct inode *inode)
        switch (sbp->s_magic) {
        case SMACK_MAGIC:
        case CGROUP_SUPER_MAGIC:
+       case CGROUP2_SUPER_MAGIC:
                /*
                 * Casey says that it's a little embarrassing
                 * that the smack file system doesn't do