[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[XEN PATCH] xen: allow XSM_FLASK_POLICY only if checkpolicy binary is available


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
  • Date: Wed, 14 Jul 2021 17:17:34 +0100
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Anthony PERARD <anthony.perard@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, "Ian Jackson" <iwj@xxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 14 Jul 2021 16:23:52 +0000
  • Ironport-hdrordr: A9a23:I4PKu6uVbR7gxmjEVuyCXE507skDetV00zEX/kB9WHVpmszxra 6TdZMgpHvJYVcqKRcdcL+7WJVoLUmxyXcX2/h1AV7BZniEhILAFugLhuGO/9SJIVyYygc378 ZdmsZFZ+EYdWIK7/rH3A==
  • Ironport-sdr: nzDWEIqEia5qkWyJaarIh+nToFrTzhY5WJHPYOawEI5b8udIxJ/IVYjmpnzLxStjoQ80UYv98S UlgJKh3EKCqTSktwOaoMFUb4C40uxoDBmIHI+PsQ/4mI3IXe9TTslLDiMREgw3xEXj6gCe21dJ 4wzyg2mGZyILosnQaZtb77myRNibyZNfpoIvU03WZ54uLnfQSyBP6dPKsoi89hBqkUmc7ynhoY 5XUY1sK9IArkDSDc4GseAbaS+y3hiVnUgxVX7uhrUJFc+uROQ+pQ2PFhrg4SovdNWI02NBtwse Wz0=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

This will help prevent the CI loop from having build failures when
`checkpolicy` isn't available, when doing "randconfig" jobs.

Signed-off-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>
---
 Config.mk          | 6 ------
 xen/Makefile       | 2 ++
 xen/common/Kconfig | 7 +++++--
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/Config.mk b/Config.mk
index d08fa8d60dd7..97d3633706b3 100644
--- a/Config.mk
+++ b/Config.mk
@@ -137,12 +137,6 @@ export XEN_HAS_BUILD_ID=y
 build_id_linker := --build-id=sha1
 endif
 
-ifndef XEN_HAS_CHECKPOLICY
-    CHECKPOLICY ?= checkpolicy
-    XEN_HAS_CHECKPOLICY := $(shell $(CHECKPOLICY) -h 2>&1 | grep -q xen && 
echo y || echo n)
-    export XEN_HAS_CHECKPOLICY
-endif
-
 define buildmakevars2shellvars
     export PREFIX="$(prefix)";                                            \
     export XEN_SCRIPT_DIR="$(XEN_SCRIPT_DIR)";                            \
diff --git a/xen/Makefile b/xen/Makefile
index 8023680ffbf2..a60e49903d0c 100644
--- a/xen/Makefile
+++ b/xen/Makefile
@@ -17,6 +17,8 @@ export XEN_BUILD_HOST ?= $(shell hostname)
 PYTHON_INTERPRETER     := $(word 1,$(shell which python3 python python2 
2>/dev/null) python)
 export PYTHON          ?= $(PYTHON_INTERPRETER)
 
+export CHECKPOLICY     ?= checkpolicy
+
 export BASEDIR := $(CURDIR)
 export XEN_ROOT := $(BASEDIR)/..
 
diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index 0ddd18e11af3..13537e460b8f 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -25,6 +25,9 @@ config GRANT_TABLE
 config HAS_ALTERNATIVE
        bool
 
+config HAS_CHECKPOLICY
+       def_bool $(success,$(CHECKPOLICY) -h 2>&1 | grep -q xen)
+
 config HAS_COMPAT
        bool
 
@@ -235,8 +238,8 @@ config XSM_FLASK_AVC_STATS
 
 config XSM_FLASK_POLICY
        bool "Compile Xen with a built-in FLASK security policy"
-       default y if "$(XEN_HAS_CHECKPOLICY)" = "y"
-       depends on XSM_FLASK
+       default y
+       depends on XSM_FLASK && HAS_CHECKPOLICY
        ---help---
          This includes a default XSM policy in the hypervisor so that the
          bootloader does not need to load a policy to get sane behavior from an
-- 
Anthony PERARD




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.