diff options
author | Wei Yongjun <weiyongjun1@huawei.com> | 2016-09-10 03:43:48 -0400 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2016-09-13 17:14:43 -0400 |
commit | 9b6a9ecc2d88ccdc57efc22d69436b9dd7e2eceb (patch) | |
tree | 40391e0237dd127fec6134c89fdb7667c8d58ebc | |
parent | 7c686af071ade663d0995aa30b262495a6c68c88 (diff) |
selinux: fix error return code in policydb_read()
Fix to return error code -EINVAL from the error handling case instead
of 0 (rc is overwrite to 0 when policyvers >=
POLICYDB_VERSION_ROLETRANS), as done elsewhere in this function.
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
[PM: normalize "selinux" in patch subject, description line wrap]
Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r-- | security/selinux/ss/policydb.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c index 8c661f0451ec..ace683838d80 100644 --- a/security/selinux/ss/policydb.c +++ b/security/selinux/ss/policydb.c | |||
@@ -2417,6 +2417,7 @@ int policydb_read(struct policydb *p, void *fp) | |||
2417 | } else | 2417 | } else |
2418 | tr->tclass = p->process_class; | 2418 | tr->tclass = p->process_class; |
2419 | 2419 | ||
2420 | rc = -EINVAL; | ||
2420 | if (!policydb_role_isvalid(p, tr->role) || | 2421 | if (!policydb_role_isvalid(p, tr->role) || |
2421 | !policydb_type_isvalid(p, tr->type) || | 2422 | !policydb_type_isvalid(p, tr->type) || |
2422 | !policydb_class_isvalid(p, tr->tclass) || | 2423 | !policydb_class_isvalid(p, tr->tclass) || |