Skip to content

Commit 9b6a9ec

Browse files
Wei Yongjunpcmoore
authored andcommitted
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>
1 parent 7c686af commit 9b6a9ec

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎security/selinux/ss/policydb.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2417,6 +2417,7 @@ int policydb_read(struct policydb *p, void *fp)
24172417
} else
24182418
tr->tclass = p->process_class;
24192419

2420+
rc = -EINVAL;
24202421
if (!policydb_role_isvalid(p, tr->role) ||
24212422
!policydb_type_isvalid(p, tr->type) ||
24222423
!policydb_class_isvalid(p, tr->tclass) ||

0 commit comments

Comments
 (0)