aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/security/selinux/ss/policydb.c
diff options
context:
space:
mode:
authorPaul Moore <paul@paul-moore.com>2023-08-07 22:57:22 -0400
committerPaul Moore <paul@paul-moore.com>2023-08-09 10:51:13 -0400
commit817199e006e514e6c39a17ed2e9fece1bd56b898 (patch)
treef450f46e3941356c1b9aae3d7fbe26af4e2f9cd4 /security/selinux/ss/policydb.c
parentselinux: use GFP_KERNEL while reading binary policy (diff)
downloadwireguard-linux-817199e006e514e6c39a17ed2e9fece1bd56b898.tar.xz
wireguard-linux-817199e006e514e6c39a17ed2e9fece1bd56b898.zip
selinux: revert SECINITSID_INIT support
This commit reverts 5b0eea835d4e ("selinux: introduce an initial SID for early boot processes") as it was found to cause problems on distros with old SELinux userspace tools/libraries, specifically Ubuntu 16.04. Hopefully we will be able to re-add this functionality at a later date, but let's revert this for now to help ensure a stable and backwards compatible SELinux tree. Link: https://lore.kernel.org/selinux/87edkseqf8.fsf@mail.lhotse Acked-by: Ondrej Mosnacek <omosnace@redhat.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/ss/policydb.c')
-rw-r--r--security/selinux/ss/policydb.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index bb850b608dc6..cd44b13b8d3f 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -864,8 +864,6 @@ void policydb_destroy(struct policydb *p)
int policydb_load_isids(struct policydb *p, struct sidtab *s)
{
struct ocontext *head, *c;
- bool isid_init_supported = ebitmap_get_bit(&p->policycaps,
- POLICYDB_CAP_USERSPACE_INITIAL_CONTEXT);
int rc;
rc = sidtab_init(s);
@@ -889,13 +887,6 @@ int policydb_load_isids(struct policydb *p, struct sidtab *s)
if (!name)
continue;
- /*
- * Also ignore SECINITSID_INIT if the policy doesn't declare
- * support for it
- */
- if (sid == SECINITSID_INIT && !isid_init_supported)
- continue;
-
rc = sidtab_set_initial(s, sid, &c->context[0]);
if (rc) {
pr_err("SELinux: unable to load initial SID %s.\n",
@@ -903,24 +894,6 @@ int policydb_load_isids(struct policydb *p, struct sidtab *s)
sidtab_destroy(s);
return rc;
}
-
- /*
- * If the policy doesn't support the "userspace_initial_context"
- * capability, set SECINITSID_INIT to the same context as
- * SECINITSID_KERNEL. This ensures the same behavior as before
- * the reintroduction of SECINITSID_INIT, where all tasks
- * started before policy load would initially get the context
- * corresponding to SECINITSID_KERNEL.
- */
- if (sid == SECINITSID_KERNEL && !isid_init_supported) {
- rc = sidtab_set_initial(s, SECINITSID_INIT, &c->context[0]);
- if (rc) {
- pr_err("SELinux: unable to load initial SID %s.\n",
- name);
- sidtab_destroy(s);
- return rc;
- }
- }
}
return 0;
}