-
由 Stephen Smalley 提交于
commit 7bb185ed upstream. commit 901ef845 ("selinux: allow per-file labeling for cgroupfs") broke mounting of cgroup2 under older SELinux policies which lacked a genfscon rule for cgroup2. This prevents mounting of cgroup2 even when SELinux is permissive. Change the handling when there is no genfscon rule in policy to just mark the inode unlabeled and not return an error to the caller. This permits mounting and access if allowed by policy, e.g. to unconfined domains. I also considered changing the behavior of security_genfs_sid() to never return -ENOENT, but the current behavior is relied upon by other callers to perform caller-specific handling. Fixes: 901ef845 ("selinux: allow per-file labeling for cgroupfs") CC: <stable@vger.kernel.org> Reported-by: NDmitry Vyukov <dvyukov@google.com> Reported-by: NWaiman Long <longman@redhat.com> Signed-off-by: NStephen Smalley <sds@tycho.nsa.gov> Tested-by: NWaiman Long <longman@redhat.com> Signed-off-by: NPaul Moore <paul@paul-moore.com> Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
f77c8467