SELinux: fix error return code in policydb_read()
PATCH 1/1 SELinux: fix error return code in policydb_read()
From: Wei Yongjun <[email protected]>
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 <[email protected]>
--- security/selinux/ss/policydb.c | 1 + 1 file changed, 1 insertion(+)
security/selinux/ss/policydb.c +1 -0
@@ -2417,6 +2417,7 @@ int policydb_read(struct policydb *p, void *fp) }else tr->tclass = p->process_class; + rc = -EINVAL ; if (!policydb_role_isvalid(p, tr->role) || !policydb_type_isvalid(p, tr->type) || !policydb_class_isvalid(p, tr->tclass) ||
Paul Moore
maintainerQuoted 10 lines · Wei Yongjun
From: Wei Yongjun <[email protected]>
Fix to return error code
-EINVALfrom 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 <[email protected]>--- security/selinux/ss/policydb.c | 1 + 1 file changed, 1 insertion(+)
Nice catch, thanks for the patch; it has been merged into the selinux#next branch.
Quoted 13 lines
security/selinux/ss/policydb.c +1
-0@@ -2417,6 +2417,7 @@ int policydb_read(struct policydb *p, void *fp) }else tr->tclass = p->process_class; + rc = -EINVAL ; if (!policydb_role_isvalid(p, tr->role) || !policydb_type_isvalid(p, tr->type) || !policydb_class_isvalid(p, tr->tclass) ||
Signature · 2 lines
paul moore www.paul-moore.com