All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libsepol: Skip aliases when creating the type_attr_map
@ 2026-08-12 15:28 James Carter
  2026-08-12 15:35 ` Stephen Smalley
  0 siblings, 1 reply; 3+ messages in thread
From: James Carter @ 2026-08-12 15:28 UTC (permalink / raw)
  To: selinux; +Cc: stephen.smalley.work, James Carter

Aliases that have primary == 0 share the same value as their
primary, so there is no need to process them when creating the
type_attr_map.

Skip aliases with primary == 0 when creating the type_attr_map.

Signed-off-by: James Carter <jwcart2@gmail.com>
---
 libsepol/src/expand.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libsepol/src/expand.c b/libsepol/src/expand.c
index 3d5bae83..18718973 100644
--- a/libsepol/src/expand.c
+++ b/libsepol/src/expand.c
@@ -2646,6 +2646,10 @@ static int type_attr_map(hashtab_key_t key __attribute__((unused)),
 	type = (type_datum_t *)datum;
 	value = type->s.value;
 
+	/* Skip aliases since they have the same value as their primary */
+	if (!type->primary)
+		return 0;
+
 	if (type->flavor == TYPE_ATTRIB) {
 		if (!(type->flags & TYPE_FLAGS_EXPAND_ATTR_TRUE)) {
 			if (ebitmap_cpy(&p->attr_type_map[value - 1],
-- 
2.55.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-08-12 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-12 15:28 [PATCH] libsepol: Skip aliases when creating the type_attr_map James Carter
2026-08-12 15:35 ` Stephen Smalley
2026-08-12 15:46   ` Stephen Smalley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.