mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 2/6] selinux: dump statistics for more hash tables
@ 2023-08-18 15:12 Christian Göttsche
  2023-08-18 15:12 ` [PATCH 3/6] selinux: improve debug configuration Christian Göttsche
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Christian Göttsche @ 2023-08-18 15:12 UTC (permalink / raw)
  To: selinux
  Cc: Paul Moore, Stephen Smalley, Eric Paris, Ondrej Mosnacek, linux-kernel

Dump in the SELinux debug configuration the statistics for the
conditional rules avtab, the role transition, and class and common
permission hash tables.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 security/selinux/ss/conditional.c | 3 +++
 security/selinux/ss/policydb.c    | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/security/selinux/ss/conditional.c b/security/selinux/ss/conditional.c
index 81ff676f209a..0dd17fe76286 100644
--- a/security/selinux/ss/conditional.c
+++ b/security/selinux/ss/conditional.c
@@ -171,6 +171,9 @@ int cond_init_bool_indexes(struct policydb *p)
 					      GFP_KERNEL);
 	if (!p->bool_val_to_struct)
 		return -ENOMEM;
+
+	avtab_hash_eval(&p->te_cond_avtab, "conditional_rules");
+
 	return 0;
 }
 
diff --git a/security/selinux/ss/policydb.c b/security/selinux/ss/policydb.c
index 84f02d4f8093..932e383bcad6 100644
--- a/security/selinux/ss/policydb.c
+++ b/security/selinux/ss/policydb.c
@@ -1158,6 +1158,8 @@ static int common_read(struct policydb *p, struct symtab *s, void *fp)
 			goto bad;
 	}
 
+	hash_eval(&comdatum->permissions.table, "common_permissions");
+
 	rc = symtab_insert(s, key, comdatum);
 	if (rc)
 		goto bad;
@@ -1339,6 +1341,8 @@ static int class_read(struct policydb *p, struct symtab *s, void *fp)
 			goto bad;
 	}
 
+	hash_eval(&cladatum->permissions.table, "class_permissions");
+
 	rc = read_cons_helper(p, &cladatum->constraints, ncons, 0, fp);
 	if (rc)
 		goto bad;
@@ -2616,6 +2620,8 @@ int policydb_read(struct policydb *p, void *fp)
 		rtd = NULL;
 	}
 
+	hash_eval(&p->role_tr, "roletr");
+
 	rc = next_entry(buf, fp, sizeof(u32));
 	if (rc)
 		goto bad;
-- 
2.40.1


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

end of thread, other threads:[~2023-09-13 18:08 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-18 15:12 [PATCH 2/6] selinux: dump statistics for more hash tables Christian Göttsche
2023-08-18 15:12 ` [PATCH 3/6] selinux: improve debug configuration Christian Göttsche
2023-09-08 16:08   ` Stephen Smalley
2023-09-13 17:46   ` Paul Moore
2023-08-18 15:12 ` [PATCH 4/6] selinux: simplify avtab slot calculation Christian Göttsche
2023-09-08 18:44   ` Stephen Smalley
2023-09-13 17:46   ` Paul Moore
2023-08-18 15:12 ` [PATCH 5/6] selinux: improve role transition hashing Christian Göttsche
2023-09-08 18:46   ` Stephen Smalley
2023-09-13 17:46   ` Paul Moore
2023-08-18 15:12 ` [PATCH 6/6] selinux: improve symtab string hashing Christian Göttsche
2023-09-07 17:44   ` Stephen Smalley
2023-09-13 17:46     ` Paul Moore
2023-09-08 18:49   ` Stephen Smalley
2023-08-18 15:12 ` [PATCH 1/6] selinux: print sum of chain lengths^2 for hash tables Christian Göttsche
2023-09-08 18:47   ` Stephen Smalley
2023-09-13 17:46   ` Paul Moore
2023-09-07 17:42 ` [PATCH 2/6] selinux: dump statistics for more " Stephen Smalley
2023-09-13 16:11   ` Paul Moore
2023-09-13 18:03     ` Stephen Smalley
2023-09-13 18:07       ` Paul Moore
2023-09-08 18:03 ` Stephen Smalley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®