Skip to content

libselinux: add a configuration-root search list

Stephen Smalley selinux 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 1 replyIn review
  2. v34 patches 0 repliesSuperseded
  3. v24 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v14 patches0 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4libselinux: add a configuration-root search listlibselinux/src/init.c libselinux/src/selinux_config.c libselinux/src/selinux_internal.h+156 -90 replies
2/4libselinux: search for the binary policy across configuration rootslibselinux/src/load_policy.c libselinux/src/selinux_config.c+29 -200 replies
3/4libselinux: fall back through configuration rootslibselinux/src/booleans.c libselinux/src/get_context_list.c libselinux/src/get_default_type.c +7 more+15 -140 replies
4/4libselinux: search file_contexts files across configuration rootslibselinux/src/label_file.c libselinux/src/selinux_config.c libselinux/src/selinux_internal.h+83 -70 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.

Read the v4 thread

Cover letter [PATCH v4 0/4] libselinux: add a configuration-root search list

This series is the first half of addressing
https://github.com/SELinuxProject/selinux/issues/33

It adds a configuration-root search list to libselinux so that it searches an ordered list of configuration roots for each configuration file. The list can be overridden at build time via -DSELINUXFALLBACKDIRS=. There is no change in behavior as long as the files are found in their default locations under /etc/selinux; the fallbacks are only used when those files are missing, e.g. upon a factory reset.

The second half of this series will address libsemanage but is not necessary to merge this half.

v4 drops the /run/selinux directory from the default configuration-root search list since it is not required to support the stateless use case and it introduces a potential risk of any domain that can write to var_run_t being able to inject files that will be used by libselinux. Distros are still free to add it back using -DSELINUXFALLBACKDIRS= but if you do so, be sure to create and label /run/selinux appropriately.

Stephen Smalley (4):
libselinux: add a configuration-root search list
libselinux: search for the binary policy across configuration roots
libselinux: fall back through configuration roots
libselinux: search file_contexts files across configuration roots

 libselinux/src/booleans.c                     |   2 +-
 libselinux/src/get_context_list.c             |   6 +-
 libselinux/src/get_default_type.c             |   5 +-
 libselinux/src/init.c                         |  12 +-
 libselinux/src/is_customizable_type.c         |   2 +-
 libselinux/src/label_db.c                     |   2 +-
 libselinux/src/label_file.c                   |  49 ++++-
 libselinux/src/label_media.c                  |   2 +-
 libselinux/src/label_x.c                      |   2 +-
 libselinux/src/load_policy.c                  |  24 ++-
 libselinux/src/matchmediacon.c                |   2 +-
 .../src/selinux_check_securetty_context.c     |   2 +-
 libselinux/src/selinux_config.c               | 179 ++++++++++++++++--
 libselinux/src/selinux_internal.h             |  40 ++++
 libselinux/src/seusers.c                      |   4 +-
 15 files changed, 283 insertions(+), 50 deletions(-)
Signature · 1 line
2.55.0