hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/security/selinux/ss/mls.h
....@@ -22,7 +22,10 @@
2222 #ifndef _SS_MLS_H_
2323 #define _SS_MLS_H_
2424
25
+#include <linux/jhash.h>
26
+
2527 #include "context.h"
28
+#include "ebitmap.h"
2629 #include "policydb.h"
2730
2831 int mls_compute_context_len(struct policydb *p, struct context *context);
....@@ -101,5 +104,13 @@
101104 }
102105 #endif
103106
107
+static inline u32 mls_range_hash(const struct mls_range *r, u32 hash)
108
+{
109
+ hash = jhash_2words(r->level[0].sens, r->level[1].sens, hash);
110
+ hash = ebitmap_hash(&r->level[0].cat, hash);
111
+ hash = ebitmap_hash(&r->level[1].cat, hash);
112
+ return hash;
113
+}
114
+
104115 #endif /* _SS_MLS_H */
105116