summaryrefslogtreecommitdiff
path: root/security/selinux/Makefile
diff options
context:
space:
mode:
authorOndrej Mosnacek <omosnace@redhat.com>2020-04-17 10:11:56 +0200
committerPaul Moore <paul@paul-moore.com>2020-04-17 16:04:34 -0400
commit50077289804c9bd4e6cfd5b3a10d4da0487f7e42 (patch)
treed0eec42d8fa215c2a80419f934159286d5d025d5 /security/selinux/Makefile
parente67b2ec9f6171895e774f6543626913960e019df (diff)
selinux: hash context structure directly
Always hashing the string representation is inefficient. Just hash the contents of the structure directly (using jhash). If the context is invalid (str & len are set), then hash the string as before, otherwise hash the structured data. Since the context hashing function is now faster (about 10 times), this patch decreases the overhead of security_transition_sid(), which is called from many hooks. The jhash function seemed as a good choice, since it is used as the default hashing algorithm in rhashtable. Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com> Reviewed-by: Jeff Vander Stoep <jeffv@google.com> Tested-by: Jeff Vander Stoep <jeffv@google.com> [PM: fixed some spelling errors in the comments pointed out by JVS] Signed-off-by: Paul Moore <paul@paul-moore.com>
Diffstat (limited to 'security/selinux/Makefile')
-rw-r--r--security/selinux/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/selinux/Makefile b/security/selinux/Makefile
index 0c77ede1cc11..4d8e0e8adf0b 100644
--- a/security/selinux/Makefile
+++ b/security/selinux/Makefile
@@ -8,7 +8,7 @@ obj-$(CONFIG_SECURITY_SELINUX) := selinux.o
selinux-y := avc.o hooks.o selinuxfs.o netlink.o nlmsgtab.o netif.o \
netnode.o netport.o status.o \
ss/ebitmap.o ss/hashtab.o ss/symtab.o ss/sidtab.o ss/avtab.o \
- ss/policydb.o ss/services.o ss/conditional.o ss/mls.o
+ ss/policydb.o ss/services.o ss/conditional.o ss/mls.o ss/context.o
selinux-$(CONFIG_SECURITY_NETWORK_XFRM) += xfrm.o