Skip to content

Commit 71ecdc1

Browse files
opsiffgregkh
authored andcommitted
Revert "selinux: reject a permission value exceeding the class permission count"
This reverts commit 9b46fba. The stable pick applied the nprim bound after symtab_insert() because the upstream context (the SEL_VEC_MAX check from commit 18fa21f "selinux: more strict policy parsing") does not exist in this tree. On that error path perm_destroy() frees a key/datum pair that is already linked into the symtab, leading to a double free when the failed policydb is torn down. Drop it here; it is re-applied later in this series in its upstream form, after its strict-parsing prerequisite. Signed-off-by: Wentao Guan <guanwentao@uniontech.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 64561af commit 71ecdc1

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

security/selinux/ss/policydb.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1168,9 +1168,6 @@ static int perm_read(struct policydb *p, struct symtab *s, struct policy_file *f
11681168
rc = symtab_insert(s, key, perdatum);
11691169
if (rc)
11701170
goto bad;
1171-
/* indexes an nprim-sized array in security_get_permissions() */
1172-
if (perdatum->value > s->nprim)
1173-
goto bad;
11741171

11751172
return 0;
11761173
bad:

0 commit comments

Comments
 (0)