Skip to content

SELinux improvements

Thomas Petazzoni buildroot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest30 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30package/policycoreutils: drop host-dbus-glib dependency from host-policycoreutilspackage/policycoreutils/policycoreutils.mk+1 -10 replies
2/30package/policycoreutils: drop host-python(3) dependency for host-policycoreutilspackage/policycoreutils/policycoreutils.mk+0 -120 replies
3/30package/policycoreutils: drop host-setools dependency from host-policycoreutilspackage/policycoreutils/policycoreutils.mk+1 -20 replies
4/30package/policycoreutils: drop ARCH variablepackage/policycoreutils/policycoreutils.mk+1 -30 replies
5/30package/policycoreutils: don't pass DESTDIR when building host variantpackage/policycoreutils/policycoreutils.mk+3 -40 replies
6/30package/libsemanage: drop dependency on ustrpackage/libsemanage/Config.in package/libsemanage/libsemanage.mk+2 -30 replies
7/30package/ustr: remove packageConfig.in.legacy DEVELOPERS package/Config.in +3 more+8 -630 replies
8/30package/libsemanage: reformat HOST_LIBSEMANAGE_DEPENDENCIESpackage/libsemanage/libsemanage.mk+7 -20 replies
9/30package/musl-fts: new packageDEVELOPERS package/Config.in package/musl-fts/Config.in +2 more+33 -03 replies
9/30package/musl-fts: new package+0 -02 replies
9/30package/musl-fts: new package+0 -00 replies
10/30package/libselinux: allow building on !glibc using musl-ftspackage/libselinux/Config.in package/libselinux/libselinux.mk+8 -50 replies
11/30package/busybox: selinux support now available on !glibc configspackage/busybox/Config.in+0 -10 replies
12/30package/checkpolicy: now available on !glibc configspackage/checkpolicy/Config.in+2 -40 replies
13/30package/audit: re-enable on muslpackage/audit/0002-Add-substitue-functions-for-strndupa-rawmemchr.patch package/audit/Config.in package/audit/audit.mk+137 -40 replies
14/30package/selinux-python: now available on !glibc configspackage/selinux-python/Config.in+1 -20 replies
15/30package/setools: now available on !glibc configspackage/setools/Config.in+2 -40 replies
16/30package/android-tools: fastboot now available on !glibc toolchainspackage/android-tools/Config.in+2 -40 replies
17/30package/restorecond: now available on !glibc configspackage/restorecond/Config.in+1 -20 replies
18/30package/libsemanage: now available on !glibc configspackage/libsemanage/Config.in+2 -70 replies
19/30package/policycoreutils: now available on !glibc configspackage/policycoreutils/Config.in+2 -40 replies
20/30package/refpolicy: now available on !glibc configspackage/refpolicy/Config.in+2 -40 replies
21/30package/libselinux: re-enable on ARCpackage/libselinux/Config.in+0 -30 replies
22/30package/setools: re-enable on ARCpackage/setools/Config.in+1 -20 replies
23/30package/checkpolicy: re-enable on ARCpackage/checkpolicy/Config.in+0 -20 replies
24/30package/selinux-python: re-enable audit2allow on ARCpackage/selinux-python/Config.in+0 -20 replies
25/30package/busybox: re-enable SELinux support on ARCpackage/busybox/Config.in+0 -10 replies
26/30package/restorecond: re-enable on ARCpackage/restorecond/Config.in+0 -20 replies
27/30package/libsemanage: drop !BR2_arc dependencypackage/libsemanage/Config.in+0 -20 replies
28/30package/policycoreutils: drop !BR2_arc dependencypackage/policycoreutils/Config.in+0 -20 replies
29/30package/refpolicy: drop !BR2_arc dependencypackage/refpolicy/Config.in+0 -20 replies
30/30package/android-tools: re-enable fastboot on ARCpackage/android-tools/Config.in+0 -20 replies

Reviews trailers per patch

3 of 32 patches have a Reviewed-by or Acked-by.

PatchMatt Weber
1/30
2/30
3/30
4/30
5/30
6/30
7/30
8/30
9/30R-b
9/30R-b
9/30R-b
10/30
11/30
12/30
13/30
14/30
15/30
16/30
17/30
18/30
19/30
20/30
21/30
22/30
23/30
24/30
25/30
26/30
27/30
28/30
29/30
30/30

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

Read the v1 thread

Cover letter [Buildroot] [PATCH 00/30] SELinux improvements

Hello,

While working on SELinux support in OpenWRT, I re-did the packaging of a number of SELinux components, and found that a few things could be improved in Buildroot. Most notably, OpenWRT uses musl as the C library, and I was able to make the SELinux stack working on musl without too much effort, while libselinux (and consequently the rest of the SELinux stack) in Buildroot currently depends on glibc.

So, this patch series:

- Drops a number of dependencies of host-policycoreutils that are no longer needed, and drops passing the ARCH and DESTDIR variables when they are not needed

- Drops the ustr depends from libsemanage (it is no longer used) and remove the ustr package as it was only used by libsemanage.

- Introduces the musl-fts package, which is a replacement fts implementation that can be used when the C library is musl or uClibc-ng with FTS support disabled (which is our case). Then libselinux is modified to use musl-fts, and the glibc dependency is dropped from libselinux and all its reverse dependencies.

- Re-enables libselinux on ARC (it was disabled on this architecture back in 2015, due to toolchain issues, but they are resolved): the !BR2_arc dependency is dropped from libselinux and all its reverse dependencies

This patch series has been tested with the following defconfigs:

* An ARM uClibc defconfig, with all affected packages enabled:

BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-full-2019.05.1.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_4_9=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_14=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_CHECKPOLICY=y
BR2_PACKAGE_REFPOLICY=y
BR2_PACKAGE_RESTORECOND=y
BR2_PACKAGE_SELINUX_PYTHON=y
BR2_PACKAGE_SEMODULE_UTILS=y
BR2_PACKAGE_SETOOLS=y
BR2_PACKAGE_ANDROID_TOOLS=y
BR2_PACKAGE_ANDROID_TOOLS_FASTBOOT=y
BR2_PACKAGE_ANDROID_TOOLS_ADB=y
BR2_PACKAGE_ANDROID_TOOLS_ADBD=y
# BR2_TARGET_ROOTFS_TAR is not set

* An ARM musl defconfig, with all affected packages enabled:

BR2_arm=y
BR2_cortex_a9=y
BR2_ARM_ENABLE_VFP=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arm-cortex-a9-musl-2019.05.1.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_7=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_5_1=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM_MUSL=y
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
BR2_PACKAGE_BUSYBOX_SHOW_OTHERS=y
BR2_PACKAGE_CHECKPOLICY=y
BR2_PACKAGE_REFPOLICY=y
BR2_PACKAGE_RESTORECOND=y
BR2_PACKAGE_SELINUX_PYTHON=y
BR2_PACKAGE_SEMODULE_UTILS=y
BR2_PACKAGE_SETOOLS=y
BR2_PACKAGE_ANDROID_TOOLS=y
BR2_PACKAGE_ANDROID_TOOLS_FASTBOOT=y
BR2_PACKAGE_ANDROID_TOOLS_ADB=y
BR2_PACKAGE_ANDROID_TOOLS_ADBD=y
# BR2_TARGET_ROOTFS_TAR is not set

* An ARC defconfig, with all affected packages enabled, which can be enabled on ARC (indeed 'audit' is still not available on ARC)

BR2_arcle=y
BR2_archs38=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_TOOLCHAIN_EXTERNAL_CUSTOM=y
BR2_TOOLCHAIN_EXTERNAL_DOWNLOAD=y BR2_TOOLCHAIN_EXTERNAL_URL="http://autobuild.buildroot.org/toolchains/tarballs/br-arcle-hs38-full-2019.05.1.tar.bz2" BR2_TOOLCHAIN_EXTERNAL_GCC_8=y
BR2_TOOLCHAIN_EXTERNAL_HEADERS_4_9=y
BR2_TOOLCHAIN_EXTERNAL_LOCALE=y
# BR2_TOOLCHAIN_EXTERNAL_HAS_THREADS_DEBUG is not set
BR2_TOOLCHAIN_EXTERNAL_CXX=y
BR2_INIT_NONE=y
BR2_SYSTEM_BIN_SH_NONE=y
# BR2_PACKAGE_BUSYBOX is not set
BR2_PACKAGE_RESTORECOND=y
BR2_PACKAGE_SELINUX_PYTHON=y
BR2_PACKAGE_SELINUX_PYTHON_AUDIT2ALLOW=y
BR2_PACKAGE_SETOOLS=y
BR2_PACKAGE_ANDROID_TOOLS=y
BR2_PACKAGE_ANDROID_TOOLS_FASTBOOT=y
BR2_PACKAGE_ANDROID_TOOLS_ADB=y
BR2_PACKAGE_ANDROID_TOOLS_ADBD=y
# BR2_TARGET_ROOTFS_TAR is not set

Best regards,

Thomas Petazzoni

Thomas Petazzoni (30):
package/policycoreutils: drop host-dbus-glib dependency from
host-policycoreutils
package/policycoreutils: drop host-python(3) dependency for
host-policycoreutils
package/policycoreutils: drop host-setools dependency from
host-policycoreutils
package/policycoreutils: drop ARCH variable package/policycoreutils: don't pass DESTDIR when building host variant package/libsemanage: drop dependency on ustr
package/ustr: remove package
package/libsemanage: reformat HOST_LIBSEMANAGE_DEPENDENCIES package/musl-fts: new package
package/libselinux: allow building on !glibc using musl-fts package/busybox: selinux support now available on !glibc configs package/checkpolicy: now available on !glibc configs package/audit: re-enable on musl
package/selinux-python: now available on !glibc configs package/setools: now available on !glibc configs package/android-tools: fastboot now available on !glibc toolchains package/restorecond: now available on !glibc configs package/libsemanage: now available on !glibc configs package/policycoreutils: now available on !glibc configs package/refpolicy: now available on !glibc configs package/libselinux: re-enable on ARC
package/setools: re-enable on ARC
package/checkpolicy: re-enable on ARC package/selinux-python: re-enable audit2allow on ARC package/busybox: re-enable SELinux support on ARC package/restorecond: re-enable on ARC
package/libsemanage: drop !BR2_arc dependency package/policycoreutils: drop !BR2_arc dependency package/refpolicy: drop !BR2_arc dependency package/android-tools: re-enable fastboot on ARC

 Config.in.legacy                              |   8 ++
 DEVELOPERS                                    |   2 +-
 package/Config.in                             |   2 +-
 package/android-tools/Config.in               |   8 +-
 ...tue-functions-for-strndupa-rawmemchr.patch | 133 ++++++++++++++++++
 package/audit/Config.in                       |   6 +-
 package/audit/audit.mk                        |   2 +
 package/busybox/Config.in                     |   2 -
 package/checkpolicy/Config.in                 |   8 +-
 package/libselinux/Config.in                  |  11 +-
 package/libselinux/libselinux.mk              |   5 +
 package/libsemanage/Config.in                 |  12 +-
 package/libsemanage/libsemanage.mk            |  11 +-
 package/musl-fts/Config.in                    |   7 +
 package/musl-fts/musl-fts.hash                |   3 +
 package/musl-fts/musl-fts.mk                  |  21 +++
 package/policycoreutils/Config.in             |   8 +-
 package/policycoreutils/policycoreutils.mk    |  26 +---
 package/refpolicy/Config.in                   |   8 +-
 package/restorecond/Config.in                 |   5 +-
 package/selinux-python/Config.in              |   5 +-
 package/setools/Config.in                     |   9 +-
 package/ustr/Config.in                        |  13 --
 package/ustr/ustr.hash                        |   9 --
 package/ustr/ustr.mk                          |  39 -----
 25 files changed, 214 insertions(+), 149 deletions(-)
 create mode 100644 package/audit/0002-Add-substitue-functions-for-strndupa-rawmemchr.patch
 create mode 100644 package/musl-fts/Config.in
 create mode 100644 package/musl-fts/musl-fts.hash
 create mode 100644 package/musl-fts/musl-fts.mk
 delete mode 100644 package/ustr/Config.in
 delete mode 100644 package/ustr/ustr.hash
 delete mode 100644 package/ustr/ustr.mk
Signature · 1 line
2.21.0