selinux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Hash context structures directly
@ 2020-04-09  8:12 Ondrej Mosnacek
  2020-04-09  8:12 ` [PATCH 1/2] selinux: hash context structure directly Ondrej Mosnacek
  2020-04-09  8:12 ` [PATCH 2/2] selinux: move context hashing under sidtab Ondrej Mosnacek
  0 siblings, 2 replies; 5+ messages in thread
From: Ondrej Mosnacek @ 2020-04-09  8:12 UTC (permalink / raw)
  To: selinux, Paul Moore; +Cc: Stephen Smalley, Jeff Vander Stoep

Converting a valid context to string and hashing that is inefficient
because the conversion is slow. Instead we can hash the stucture
contents directly, which is about 10 times faster.

After that, it is possible to move the hashing under sidtab.c, which
avoids the complexity of calling context_add_hash() all over the place.

Ondrej Mosnacek (2):
  selinux: hash context structure directly
  selinux: move context hashing under sidtab

 security/selinux/Makefile      |  2 +-
 security/selinux/ss/context.c  | 28 +++++++++++
 security/selinux/ss/context.h  | 11 +----
 security/selinux/ss/ebitmap.c  | 14 ++++++
 security/selinux/ss/ebitmap.h  |  1 +
 security/selinux/ss/policydb.c |  5 --
 security/selinux/ss/services.c | 86 ++++++++++------------------------
 security/selinux/ss/services.h |  3 --
 security/selinux/ss/sidtab.c   | 32 ++++++++-----
 security/selinux/ss/sidtab.h   |  1 +
 10 files changed, 92 insertions(+), 91 deletions(-)
 create mode 100644 security/selinux/ss/context.c

-- 
2.25.2


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

end of thread, other threads:[~2020-04-16  9:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-09  8:12 [PATCH 0/2] Hash context structures directly Ondrej Mosnacek
2020-04-09  8:12 ` [PATCH 1/2] selinux: hash context structure directly Ondrej Mosnacek
2020-04-16  0:56   ` Paul Moore
2020-04-16  9:50     ` Ondrej Mosnacek
2020-04-09  8:12 ` [PATCH 2/2] selinux: move context hashing under sidtab Ondrej Mosnacek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).