Skip to content

Hash context structures directly

Ondrej Mosnacek selinux 3 versions – Applied

Status from this message: Merged into selinux/next, with the spelling correction ;)

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest2 patches 3 repliesApplied
  2. v22 patches 3 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- fix copyright year in ss/context.c (for real this time)
- move explanation of valid vs. invalid context hashing from commit msg to the code

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/2selinux: hash context structure directlysecurity/selinux/Makefile security/selinux/ss/context.c security/selinux/ss/context.h +6 more+69 -422 replies
2/2selinux: move context hashing under sidtabsecurity/selinux/ss/context.h security/selinux/ss/policydb.c security/selinux/ss/services.c +2 more+47 -581 reply

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchJeff Vander Stoep
1/2R-b T-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH v3 0/2] Hash context structures directly

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.

Changes in v3:
- fix copyright year in ss/context.c (for real this time)
- move explanation of valid vs. invalid context hashing from commit msg to the code

Changes in v2:
- extract mls hashing into mls_range_hash() and put it in mls.h
- move some changes from patch 1 into patch 2

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

 security/selinux/Makefile      |  2 +-
 security/selinux/ss/context.c  | 32 +++++++++++++
 security/selinux/ss/context.h  | 11 +----
 security/selinux/ss/ebitmap.c  | 14 ++++++
 security/selinux/ss/ebitmap.h  |  1 +
 security/selinux/ss/mls.h      | 11 +++++
 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 +
 11 files changed, 107 insertions(+), 91 deletions(-)
 create mode 100644 security/selinux/ss/context.c
Signature · 1 line
2.25.2