Skip to content

libsemanage: add ro-store-root and 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 Latest9 patches 1 replyIn review
  2. v39 patches 0 repliesSuperseded
  3. v29 patches 0 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v19 patches0 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/9libsemanage: accept a list of read-only fallback store rootslibsemanage/src/conf-parse.y libsemanage/src/conf-scan.l libsemanage/src/semanage_conf.h +2 more+141 -10 replies
2/9libsemanage: add semanage_module_find_path() and use it for readslibsemanage/src/direct_api.c libsemanage/src/modules.c libsemanage/src/modules.h +1 more+99 -330 replies
3/9libsemanage: list modules across every store rootlibsemanage/src/direct_api.c+168 -1250 replies
4/9libsemanage: read the active store through the fallback listlibsemanage/src/direct_api.c libsemanage/src/semanage_store.c+42 -260 replies
5/9libsemanage: create the writable store skeleton on first transactionlibsemanage/src/direct_api.c+13 -00 replies
6/9libsemanage: create the store root when taking a locklibsemanage/src/semanage_store.c+30 -40 replies
7/9libsemanage: refuse to remove or enable a module owned by a RO storelibsemanage/src/direct_api.c+40 -00 replies
8/9libsemanage: search /etc and /usr/lib for semanage.conflibsemanage/src/semanage_store.c+44 -160 replies
9/9libsemanage: document semanage.conf search path and ro-store-rootlibsemanage/man/man5/semanage.conf.5+32 -20 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/9] libsemanage: add ro-store-root and configuration-root search list

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

The first half can be found at
https://lore.kernel.org/selinux/[email protected]/

This series adds a ro-store-root option to semanage.conf for defining a search list of one or more read-only store roots that are then searched for all read operations when there is no corresponding file under the writable store-root. By default there is no change in behavior.

This series adds a configuration-root search list to libsemanage so that it searches an ordered list of configuration roots for semanage.conf. This list can be overridden at build time via -DSEMANAGE_CONF_DIRS=. There is no change in behavior as long as semanage.conf is found in its default location under /etc/selinux; the fallbacks are only used when it is missing.

v4 drops /run/selinux from the default semanage.conf search path and example ro-store-root config since it is not required for the stateless use case and it introduces the risk that any domain that can write to var_run_t can inject files that will be used by libsemanage. Distros are free to re-add it using -DSEMANAGE_CONF_DIRS= but if you do so, be sure to create and label /run/selinux correctly.

Stephen Smalley (9):
libsemanage: accept a list of read-only fallback store roots
libsemanage: add semanage_module_find_path() and use it for reads
libsemanage: list modules across every store root
libsemanage: read the active store through the fallback list
libsemanage: create the writable store skeleton on first transaction
libsemanage: create the store root when taking a lock
libsemanage: refuse to remove or enable a module owned by a RO store
libsemanage: search /etc and /usr/lib for semanage.conf
libsemanage: document semanage.conf search path and ro-store-root

 libsemanage/man/man5/semanage.conf.5 |  34 +-
 libsemanage/src/conf-parse.y         |  57 +++-
 libsemanage/src/conf-scan.l          |   1 +
 libsemanage/src/direct_api.c         | 458 +++++++++++++++++----------
 libsemanage/src/modules.c            |  63 +++-
 libsemanage/src/modules.h            |  10 +
 libsemanage/src/semanage_conf.h      |   2 +
 libsemanage/src/semanage_store.c     | 185 +++++++++--
 libsemanage/src/semanage_store.h     |   6 +
 9 files changed, 609 insertions(+), 207 deletions(-)
Signature · 1 line
2.55.0