]> Git Repo - linux.git/blobdiff - security/selinux/hooks.c
selinux: fix mounting of cgroup2 under older policies
[linux.git] / security / selinux / hooks.c
index ad9a9b8e997941640b6de40fd9af4a1b17f39d04..18b98b5e1e3c46d1256ad1ffacff6ebc711beed3 100644 (file)
@@ -1508,6 +1508,11 @@ static int selinux_genfs_get_sid(struct dentry *dentry,
                }
                rc = security_genfs_sid(&selinux_state, sb->s_type->name,
                                        path, tclass, sid);
+               if (rc == -ENOENT) {
+                       /* No match in policy, mark as unlabeled. */
+                       *sid = SECINITSID_UNLABELED;
+                       rc = 0;
+               }
        }
        free_page((unsigned long)buffer);
        return rc;
This page took 0.022701 seconds and 4 git commands to generate.