aboutsummaryrefslogtreecommitdiffstats
path: root/security/selinux/ss/policydb.c
diff options
context:
space:
mode:
Diffstat (limited to 'security/selinux/ss/policydb.c')
-rw-r--r--security/selinux/ss/policydb.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index e7b850ad57ee..fd62c50d6e7d 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -128,6 +128,11 @@ static struct policydb_compat_info policydb_compat[] = {
128 .sym_num = SYM_NUM, 128 .sym_num = SYM_NUM,
129 .ocon_num = OCON_NUM, 129 .ocon_num = OCON_NUM,
130 }, 130 },
131 {
132 .version = POLICYDB_VERSION_ROLETRANS,
133 .sym_num = SYM_NUM,
134 .ocon_num = OCON_NUM,
135 },
131}; 136};
132 137
133static struct policydb_compat_info *policydb_lookup_compat(int version) 138static struct policydb_compat_info *policydb_lookup_compat(int version)
@@ -2302,8 +2307,17 @@ int policydb_read(struct policydb *p, void *fp)
2302 tr->role = le32_to_cpu(buf[0]); 2307 tr->role = le32_to_cpu(buf[0]);
2303 tr->type = le32_to_cpu(buf[1]); 2308 tr->type = le32_to_cpu(buf[1]);
2304 tr->new_role = le32_to_cpu(buf[2]); 2309 tr->new_role = le32_to_cpu(buf[2]);
2310 if (p->policyvers >= POLICYDB_VERSION_ROLETRANS) {
2311 rc = next_entry(buf, fp, sizeof(u32));
2312 if (rc)
2313 goto bad;
2314 tr->tclass = le32_to_cpu(buf[0]);
2315 } else
2316 tr->tclass = p->process_class;
2317
2305 if (!policydb_role_isvalid(p, tr->role) || 2318 if (!policydb_role_isvalid(p, tr->role) ||
2306 !policydb_type_isvalid(p, tr->type) || 2319 !policydb_type_isvalid(p, tr->type) ||
2320 !policydb_class_isvalid(p, tr->tclass) ||
2307 !policydb_role_isvalid(p, tr->new_role)) 2321 !policydb_role_isvalid(p, tr->new_role))
2308 goto bad; 2322 goto bad;
2309 ltr = tr; 2323 ltr = tr;