Skip to contentSkip to conversation

libsepol: do not reject control characters in pathnames

PATCH In review Stephen Smalley 1 participant 2 messages Aug 31 SELinux security module

lore
Share & tools
lore

Stephen Smalley

author maintainer
#0 lore raw

PATCH 1/1 libsepol: do not reject control characters in pathnames

Pathnames can in fact include control characters and checkpolicy accepts them so we should not reject them in policydb_validate().

---
 libsepol/src/policydb_validate.c | 6 ------
 1 file changed, 6 deletions(-)
libsepol/src/policydb_validate.c +0 -6
index 99d27f88..5a7ee2a3 100644
@@ -1478,8 +1478,6 @@ static int validate_filename_trans(hashtab_key_t k, hashtab_datum_t d,
 		goto bad;
 	if (validate_value(ftk->tclass, &flavors[SYM_CLASSES]))
 		goto bad;
-	if (validate_string_field(ftk->name))
-		goto bad;
 	if (!ftd)
 		goto bad;
 	for (; ftd; ftd = ftd->next) {
@@ -1635,8 +1633,6 @@ static int validate_genfs(sepol_handle_t *handle, const policydb_t *p,
 			    validate_value(octx->v.sclass,
 					   &flavors[SYM_CLASSES]))
 				goto bad;
-			if (validate_string_field(octx->u.name))
-				goto bad;
 		}
 
 		if (validate_string_field(genfs->fstype))
@@ -1806,8 +1802,6 @@ validate_filename_trans_rules(sepol_handle_t *handle,
 			goto bad;
 		if (validate_simpletype(filename_trans->otype, p, flavors))
 			goto bad;
-		if (validate_string_field(filename_trans->name))
-			goto bad;
 
 		/* currently only the RULE_SELF flag can be set */
 		switch (filename_trans->flags) {
Signature · 1 line
2.55.0