All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] libsepol: Move the PERMISSION_MASK macro to private.h
@ 2026-08-25 19:41 James Carter
  2026-08-25 19:41 ` [PATCH 2/2] libsepol: Remove junk permissions before optimzing the policy James Carter
  2026-08-25 20:13 ` [PATCH 1/2] libsepol: Move the PERMISSION_MASK macro to private.h Stephen Smalley
  0 siblings, 2 replies; 5+ messages in thread
From: James Carter @ 2026-08-25 19:41 UTC (permalink / raw)
  To: selinux; +Cc: stephen.smalley.work, James Carter

Move the PERMISSION_MASK macro from policydb_validate.c to
private.h so that it can be used in other places.

Signed-off-by: James Carter <jwcart2@gmail.com>
---
 libsepol/src/policydb_validate.c | 3 ---
 libsepol/src/private.h           | 4 ++++
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/libsepol/src/policydb_validate.c b/libsepol/src/policydb_validate.c
index 7d9ae3fd..99d27f88 100644
--- a/libsepol/src/policydb_validate.c
+++ b/libsepol/src/policydb_validate.c
@@ -18,9 +18,6 @@
  * Check that at least one permission bit is valid.
  * Older compilers might set invalid bits for the wildcard permission.
  */
-#define PERMISSION_MASK(nprim)                          \
-	((nprim) == PERM_SYMTAB_SIZE ? (~UINT32_C(0)) : \
-				       ((UINT32_C(1) << (nprim)) - 1))
 #define NO_VALID_PERMS(av, nprim) (!((av) & PERMISSION_MASK(nprim)))
 
 typedef struct validate {
diff --git a/libsepol/src/private.h b/libsepol/src/private.h
index 6fc5fa2d..7f7344a8 100644
--- a/libsepol/src/private.h
+++ b/libsepol/src/private.h
@@ -45,6 +45,10 @@
 
 #define MAX_ALIAS_REPEATS 32
 
+#define PERMISSION_MASK(nprim)                          \
+	((nprim) == PERM_SYMTAB_SIZE ? (~UINT32_C(0)) : \
+				       ((UINT32_C(1) << (nprim)) - 1))
+
 static inline int exceeds_available_bytes(const struct policy_file *fp,
 					  size_t x, size_t req_elem_size)
 {
-- 
2.55.0


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

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

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-25 19:41 [PATCH 1/2] libsepol: Move the PERMISSION_MASK macro to private.h James Carter
2026-08-25 19:41 ` [PATCH 2/2] libsepol: Remove junk permissions before optimzing the policy James Carter
2026-08-25 20:14   ` Stephen Smalley
2026-08-25 20:13 ` [PATCH 1/2] libsepol: Move the PERMISSION_MASK macro to private.h Stephen Smalley
2026-08-26 12:25   ` 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.