tools: make flask utils build unconditional
PATCH 1/1 tools: make flask utils build unconditional
The flask utilities only have dependencies on libxc so there's no downside to always building it. Distros and projects based on Xen can put these utilities into a different package and not install them for everyone. Prior to this change FLASK_ENABLE needs to be a top level variable however after this change FLASK_ENABLE only affects xen/.
--- tools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/Makefile +1 -1
@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y := SUBDIRS-y += include SUBDIRS-y += libxc -SUBDIRS-$(FLASK_ENABLE) += flask +SUBDIRS-y += flask SUBDIRS-y += xenstore SUBDIRS-y += misc SUBDIRS-y += examples
Signature · 1 line
2.4.10
Quoted 7 lines · Doug Goldstein
The flask utilities only have dependencies on libxc so there's no downside to always building it. Distros and projects based on Xen can put these utilities into a different package and not install them for everyone. Prior to this change
FLASK_ENABLEneeds to be a top level variable however after this changeFLASK_ENABLEonly affects xen/.Signed-off-by Doug Goldstein <[email protected]>
CC'ing Daniel as this is a flask related change.
FWIW, Reviewed-by: Andrew Cooper <[email protected]>
Quoted 17 lines
--- tools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/Makefile +1
-1@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y := SUBDIRS-y += include SUBDIRS-y += libxc -SUBDIRS-$(FLASK_ENABLE) += flask +SUBDIRS-y += flask SUBDIRS-y += xenstore SUBDIRS-y += misc SUBDIRS-y += examples
PATCH 1/2 xen: convert FLASK_ENABLE to Kconfig
In reply to Doug GoldsteinConverts the Config.mk option of FLASK_ENABLE into a Kconfig option for the hypervisor called CONFIG_FLASK. This commit knowingly breaks the dependent relationship on XSM_ENABLE which is addressed when XSM_ENABLE is converted to Kconfig.
--- Config.mk | 1 - INSTALL | 6 +++++- docs/misc/xsm-flask.txt | 5 +++-- xen/Rules.mk | 1 - xen/common/Kconfig | 11 +++++++++++ xen/include/Makefile | 2 +- xen/include/xen/config.h | 2 +- xen/include/xen/sched.h | 2 +- xen/xsm/Makefile | 2 +- 9 files changed, 23 insertions(+), 9 deletions(-)
Config.mk +0 -1
@@ -214,7 +214,6 @@ EMBEDDED_EXTRA_CFLAGS += -fno-exceptions # Enable XSM security module (by default, Flask). XSM_ENABLE ?= n -FLASK_ENABLE ?= $(XSM_ENABLE) XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles # All the files at that location were downloaded from elsewhere on
INSTALL +5 -1
@@ -278,7 +278,11 @@ PYTHON_PREFIX_ARG= The hypervisor may be build with XSM support, which can be changed with the following variables. XSM_ENABLE=y -FLASK_ENABLE=y + +The hypervisor may be build with Flask support, which can be changed +by running: +make -C xen menuconfig +and enabling Flask in the 'Common Features' menu. Do a build for coverage. coverage=y
docs/misc/xsm-flask.txt +3 -2
@@ -172,8 +172,9 @@ Setting up FLASK ---------------- Xen must be compiled with XSM and FLASK enabled; by default, the security -framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE and -FLASK_ENABLE to "y"; this change requires a make clean and rebuild. +framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to +"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common +Features'; this change requires a make clean and rebuild. FLASK uses only one domain configuration parameter (seclabel) defining the full security label of the newly created domain. If using the example policy,
xen/Rules.mk +0 -1
@@ -53,7 +53,6 @@ CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += '-D__OBJECT_FILE__="$@"' CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE -CFLAGS-$(FLASK_ENABLE) += -DFLASK_ENABLE CFLAGS-$(verbose) += -DVERBOSE CFLAGS-$(crash_debug) += -DCRASH_DEBUG CFLAGS-$(perfc) += -DPERF_COUNTERS
xen/common/Kconfig +11 -0
@@ -8,6 +8,17 @@ config COMPAT HVM and PV guests. HVMLoader makes 32-bit hypercalls irrespective of the destination runmode of the guest. +config FLASK + bool "FLux Advanced Security Kernel support" + default n + ---help--- + Enables the FLASK (FLux Advanced Security Kernel) support which + provides a mandatory access control framework by which security + enforcement, isolation, and auditing can be achieved with fine + granular control via a security policy. + + If unsure, say N. + # Select HAS_DEVICE_TREE if device tree is supported config HAS_DEVICE_TREE bool
xen/include/Makefile +1 -1
@@ -28,7 +28,7 @@ headers-$(CONFIG_X86) += compat/arch-x86/xen.h headers-$(CONFIG_X86) += compat/arch-x86/xen-$(compat-arch-y).h headers-$(CONFIG_X86) += compat/hvm/hvm_vcpu.h headers-y += compat/arch-$(compat-arch-y).h compat/pmu.h compat/xlat.h -headers-$(FLASK_ENABLE) += compat/xsm/flask_op.h +headers-$(CONFIG_FLASK) += compat/xsm/flask_op.h cppflags-y := -include public/xen-compat.h cppflags-$(CONFIG_X86) += -m32
xen/include/xen/config.h +1 -1
@@ -86,7 +86,7 @@#define mk_unsigned_long (x) x#endif /* !__ASSEMBLY__ */ -#ifdef FLASK_ENABLE +#ifdef CONFIG_FLASK #define XSM_MAGIC 0xf97cff8c/* Maintain statistics on the access vector cache */ #define FLASK_AVC_STATS 1
xen/include/xen/sched.h +1 -1
@@ -119,7 +119,7 @@ struct evtchn*/ void *generic;#endif -#ifdef FLASK_ENABLE +#ifdef CONFIG_FLASK /* * Inlining the contents of the structure for FLASK avoids unneeded * allocations, and on 64-bit platforms with only FLASK enabled,
xen/xsm/Makefile +1 -1
@@ -4,4 +4,4 @@ obj-y += xsm_policy.o obj-y += dummy.o endif -subdir-$(FLASK_ENABLE) += flask +subdir-$(CONFIG_FLASK) += flask
Signature · 1 line
2.4.10
PATCH 2/2 xen: convert XSM_ENABLE to Kconfig
Converts the existing XSM_ENABLE flag from Config.mk to CONFIG_XSM within Kconfig. This also re-adds the dependency of CONFIG_FLASK on CONFIG_XSM.
--- Config.mk | 3 --- INSTALL | 8 ++------ docs/misc/xsm-flask.txt | 6 +++--- xen/Rules.mk | 1 - xen/common/Kconfig | 23 ++++++++++++++++++++++- xen/include/asm-x86/config.h | 4 ---- xen/include/xen/sched.h | 2 +- xen/include/xsm/dummy.h | 10 +++++----- xen/include/xsm/xsm.h | 6 +++--- xen/xsm/Makefile | 6 ++---- 10 files changed, 38 insertions(+), 31 deletions(-)
Config.mk +0 -3
@@ -212,9 +212,6 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i)) EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all EMBEDDED_EXTRA_CFLAGS += -fno-exceptions -# Enable XSM security module (by default, Flask). -XSM_ENABLE ?= n - XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles # All the files at that location were downloaded from elsewhere on # the internet. The original download URL is preserved as a comment
INSTALL +2 -6
@@ -275,14 +275,10 @@ Building the python tools may fail unless certain options are passed to setup.py. Config.mk contains additional info how to use this variable. PYTHON_PREFIX_ARG= -The hypervisor may be build with XSM support, which can be changed with -the following variables. -XSM_ENABLE=y - -The hypervisor may be build with Flask support, which can be changed +he hypervisor may be build with XSM/Flask support, which can be changed by running: make -C xen menuconfig -and enabling Flask in the 'Common Features' menu. +and enabling XSM/Flask in the 'Common Features' menu. Do a build for coverage. coverage=y
docs/misc/xsm-flask.txt +3 -3
@@ -172,9 +172,9 @@ Setting up FLASK ---------------- Xen must be compiled with XSM and FLASK enabled; by default, the security -framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to -"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common -Features'; this change requires a make clean and rebuild. +framework is disabled. Running 'make -C xen menuconfig' and enabling XSM +and FLASK inside 'Common Features'; this change requires a make clean and +rebuild. FLASK uses only one domain configuration parameter (seclabel) defining the full security label of the newly created domain. If using the example policy,
xen/Rules.mk +0 -1
@@ -52,7 +52,6 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += '-D__OBJECT_FILE__="$@"' -CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE CFLAGS-$(verbose) += -DVERBOSE CFLAGS-$(crash_debug) += -DCRASH_DEBUG CFLAGS-$(perfc) += -DPERF_COUNTERS
xen/common/Kconfig +22 -1
@@ -10,7 +10,8 @@ config COMPAT config FLASK bool "FLux Advanced Security Kernel support" - default n + default y + depends on XSM ---help--- Enables the FLASK (FLux Advanced Security Kernel) support which provides a mandatory access control framework by which security
@@ -62,4 +63,24 @@ config KEXEC If unsure, say Y. +# Allows "late" initialization of the hardware domain +config LATE_HWDOM + bool + ---help--- + Late hardware domain initialization + +# Enable/Disable XSM support +config XSM + bool "Xen Security Modules support" + default n + select LATE_HWDOM if X86 + ---help--- + Enables the security framework known as Xen Security Modules which + allows administrators fine-grained control over a Xen domain and + its capabilities by defining permissible interactions between domains, + the hypervisor itself, and related resources such as memory and + devices. + + If unsure, say N. + endmenu
xen/include/asm-x86/config.h +0 -4
@@ -52,10 +52,6 @@#define CONFIG_MULTIBOOT 1 -#ifdef XSM_ENABLE -#define CONFIG_LATE_HWDOM 1 -#endif -#define HZ 100#define OPT_CONSOLE_STR "vga"
xen/include/xen/sched.h +1 -1
@@ -110,7 +110,7 @@ struct evtchnu8 priority;u8 last_priority;u16 last_vcpu_id; -#ifdef XSM_ENABLE +#ifdef CONFIG_XSM union { #ifdef XSM_NEED_GENERIC_EVTCHN_SSID /*
xen/include/xsm/dummy.h +5 -5
@@ -27,9 +27,9 @@/* DO NOT implement this function; it is supposed to trigger link errors */ void __xsm_action_mismatch_detected (void ); -#ifdef XSM_ENABLE +#ifdef CONFIG_XSM -/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and +/* In CONFIG_XSM builds, this header file is included from xsm/dummy.c, and * contains static (not inline) functions compiled to the dummy XSM module. * There is no xsm_default_t argument available, so the value from the assertion * is used to initialize the variable.
@@ -39,9 +39,9 @@ void __xsm_action_mismatch_detected(void);#define XSM_DEFAULT_VOID void#define XSM_ASSERT_ACTION (def) xsm_default_t action = def; (void)action -#else /* XSM_ENABLE */ +#else /* CONFIG_XSM */ -/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and +/* In !CONFIG_XSM builds, this header file is included from xsm/xsm.h, and * contains inline functions for each XSM hook. These functions also perform * compile-time checks on the xsm_default_t argument to ensure that the behavior * of the dummy XSM module is the same as the behavior with XSM disabled.
@@ -51,7 +51,7 @@ void __xsm_action_mismatch_detected(void);#define XSM_DEFAULT_VOID xsm_default_t action#define XSM_ASSERT_ACTION (def) LINKER_BUG_ON(def != action) -#endif /* XSM_ENABLE */ +#endif /* CONFIG_XSM */ static always_inline int xsm_default_action(xsm_default_t action,struct domain *src,struct domain *target)
xen/include/xsm/xsm.h +3 -3
@@ -194,7 +194,7 @@ struct xsm_operations {#endif }; -#ifdef XSM_ENABLE +#ifdef CONFIG_XSM extern struct xsm_operations *xsm_ops;
@@ -752,7 +752,7 @@ extern int unregister_xsm(struct xsm_operations *ops);extern struct xsm_operations dummy_xsm_ops;extern void xsm_fixup_ops (struct xsm_operations *ops); -#else /* XSM_ENABLE */ +#else /* CONFIG_XSM */ #include <xsm/dummy.h>
@@ -772,6 +772,6 @@ static inline int xsm_dt_init(void) }#endif -#endif /* XSM_ENABLE */ +#endif /* CONFIG_XSM */ #endif /* __XSM_H */
xen/xsm/Makefile +2 -4
@@ -1,7 +1,5 @@ obj-y += xsm_core.o -ifeq ($(XSM_ENABLE),y) -obj-y += xsm_policy.o -obj-y += dummy.o -endif +obj-$(CONFIG_XSM) += xsm_policy.o +obj-$(CONFIG_XSM) += dummy.o subdir-$(CONFIG_FLASK) += flask
Signature · 1 line
2.4.10
Re: [PATCH 2/2] xen: convert XSM_ENABLE to Kconfig
Quoted 5 lines · Doug Goldstein
INSTALL +0
-0
INSTALL Building the python tools may fail unless certain options are passed to · line 278
Quoted 9 lines
INSTALL +1
-5@@ -275,14 +275,10 @@ Building the python tools may fail unless certain options are passed to setup.py. Config.mk contains additional info how to use this variable. PYTHON_PREFIX_ARG= -The hypervisor may be build with XSM support, which can be changed with -the following variables. -XSM_ENABLE=y - -The hypervisor may be build with Flask support, which can be changed +he hypervisor may be build with XSM/Flask support, which can be changed
Missing a T.
The x86 bits appear to be entirely mechanical, so Acked-by: Andrew Cooper <[email protected]>
Re: [PATCH 2/2] xen: convert XSM_ENABLE to Kconfig
In reply to Doug GoldsteinQuoted 8 lines · Doug Goldstein
Converts the existing
XSM_ENABLEflag from Config.mk toCONFIG_XSMwithinKconfig. This also re-adds the dependency ofCONFIG_FLASKonCONFIG_XSM.CC Keir Fraser <[email protected]>CC Jan Beulich <[email protected]>CC Andrew Cooper <[email protected]>Signed-off-by Doug Goldstein <[email protected]>
The dependencies for LATE_HWDOM are backwards: it is an optional X86-only feature (which probably should be off by default) that depends on XSM to work properly.
How about this for the help text:
Allows the creation of a dedicated hardware domain distinct from domain 0 that manages devices without needing access to other privileged functionality such as the ability to manage domains. This requires that the actual domain 0 be a stub domain that constructs the actual hardware domain instead of initializing the hardware itself. Because the hardware domain needs access to hypercalls not available to unprivileged guests, an XSM policy is required to properly define the privilege of these domains.
This feature does nothing if the "hardware_dom" boot parameter is not present. If this feature is being used for security, it should be combined with an IOMMU in strict mode.
If unsure, say N.
Re: [PATCH 2/2] xen: convert XSM_ENABLE to Kconfig
Quoted 5 lines · Daniel De Graaf
Quoted 4 lines · Doug Goldstein
Converts the existing
XSM_ENABLEflag from Config.mk toCONFIG_XSMwithinKconfig. This also re-adds the dependency ofCONFIG_FLASKonCONFIG_XSM.
Quoted 8 lines
Quoted 4 lines
CC Keir Fraser <[email protected]>CC Jan Beulich <[email protected]>CC Andrew Cooper <[email protected]>Signed-off-by Doug Goldstein <[email protected]>The dependencies for
LATE_HWDOMare backwards: it is an optional X86-only feature (which probably should be off by default) that depends on XSM to work properly.
Currently its always enabled if XSM_ENABLE is set. But if you are comfortable I'll tweak the patch to make this adjustable. Are you ok keeping your Ack-by as well?
Quoted 12 lines
How about this for the help text:
Allows the creation of a dedicated hardware domain distinct from domain 0 that manages devices without needing access to other privileged functionality such as the ability to manage domains. This requires that the actual domain 0 be a stub domain that constructs the actual hardware domain instead of initializing the hardware itself. Because the hardware domain needs access to hypercalls not available to unprivileged guests, an XSM policy is required to properly define the privilege of these domains.
Quoted 5 lines
This feature does nothing if the "
hardware_dom" boot parameter is not present. If this feature is being used for security, it should be combined with an IOMMU in strict mode.If unsure, say N.
Perfect! This is what I'm looking for from the various maintainers to help improve the documentation of different flags.
Signature · 1 line
Doug Goldstein
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Re: [PATCH 2/2] xen: convert XSM_ENABLE to Kconfig
Quoted 11 lines · Doug Goldstein
Quoted 10 lines · Daniel De Graaf
Quoted 8 lines · Doug Goldstein
Converts the existing
XSM_ENABLEflag from Config.mk toCONFIG_XSMwithinKconfig. This also re-adds the dependency ofCONFIG_FLASKonCONFIG_XSM.CC Keir Fraser <[email protected]>CC Jan Beulich <[email protected]>CC Andrew Cooper <[email protected]>Signed-off-by Doug Goldstein <[email protected]>
Quoted 7 lines
Quoted 3 lines
The dependencies for
LATE_HWDOMare backwards: it is an optional X86-only feature (which probably should be off by default) that depends on XSM to work properly.Currently its always enabled if
XSM_ENABLEis set. But if you are comfortable I'll tweak the patch to make this adjustable. Are you ok keeping your Ack-by as well?
Yes; Acked-by: Daniel De Graaf <[email protected]>
PATCH v2 2/2 xen: convert XSM_ENABLE to Kconfig
Converts the existing XSM_ENABLE flag from Config.mk to CONFIG_XSM within Kconfig. This also re-adds the dependency of CONFIG_FLASK on CONFIG_XSM.
---
Change from v2:
- adopt wording from Daniel De Graaf about the dedicated hardware domain
- make the dedicated hardware domain feature optional
--- Config.mk | 3 --- INSTALL | 8 ++------ docs/misc/xsm-flask.txt | 6 +++--- xen/Rules.mk | 1 - xen/common/Kconfig | 37 ++++++++++++++++++++++++++++++++++++- xen/include/asm-x86/config.h | 4 ---- xen/include/xen/sched.h | 2 +- xen/include/xsm/dummy.h | 10 +++++----- xen/include/xsm/xsm.h | 6 +++--- xen/xsm/Makefile | 6 ++---- 10 files changed, 52 insertions(+), 31 deletions(-)
Config.mk +0 -3
@@ -212,9 +212,6 @@ APPEND_CFLAGS += $(foreach i, $(APPEND_INCLUDES), -I$(i)) EMBEDDED_EXTRA_CFLAGS := -nopie -fno-stack-protector -fno-stack-protector-all EMBEDDED_EXTRA_CFLAGS += -fno-exceptions -# Enable XSM security module (by default, Flask). -XSM_ENABLE ?= n - XEN_EXTFILES_URL ?= http://xenbits.xen.org/xen-extfiles # All the files at that location were downloaded from elsewhere on # the internet. The original download URL is preserved as a comment
INSTALL +2 -6
@@ -275,14 +275,10 @@ Building the python tools may fail unless certain options are passed to setup.py. Config.mk contains additional info how to use this variable. PYTHON_PREFIX_ARG= -The hypervisor may be build with XSM support, which can be changed with -the following variables. -XSM_ENABLE=y - -The hypervisor may be build with Flask support, which can be changed +he hypervisor may be build with XSM/Flask support, which can be changed by running: make -C xen menuconfig -and enabling Flask in the 'Common Features' menu. +and enabling XSM/Flask in the 'Common Features' menu. Do a build for coverage. coverage=y
docs/misc/xsm-flask.txt +3 -3
@@ -172,9 +172,9 @@ Setting up FLASK ---------------- Xen must be compiled with XSM and FLASK enabled; by default, the security -framework is disabled. Edit Config.mk or the .config file to set XSM_ENABLE to -"y" and running 'make -C xen menuconfig' and enabling FLASK inside 'Common -Features'; this change requires a make clean and rebuild. +framework is disabled. Running 'make -C xen menuconfig' and enabling XSM +and FLASK inside 'Common Features'; this change requires a make clean and +rebuild. FLASK uses only one domain configuration parameter (seclabel) defining the full security label of the newly created domain. If using the example policy,
xen/Rules.mk +0 -1
@@ -52,7 +52,6 @@ CFLAGS += -Werror -Wredundant-decls -Wno-pointer-arith CFLAGS += -pipe -g -D__XEN__ -include $(BASEDIR)/include/xen/config.h CFLAGS += '-D__OBJECT_FILE__="$@"' -CFLAGS-$(XSM_ENABLE) += -DXSM_ENABLE CFLAGS-$(verbose) += -DVERBOSE CFLAGS-$(crash_debug) += -DCRASH_DEBUG CFLAGS-$(perfc) += -DPERF_COUNTERS
xen/common/Kconfig +36 -1
@@ -10,7 +10,8 @@ config COMPAT config FLASK bool "FLux Advanced Security Kernel support" - default n + default y + depends on XSM ---help--- Enables the FLASK (FLux Advanced Security Kernel) support which provides a mandatory access control framework by which security
@@ -62,4 +63,38 @@ config KEXEC If unsure, say Y. +# Allows "late" initialization of the hardware domain +config LATE_HWDOM + bool "dedicated hardware domain" + default n + depends on XSM && X86 + ---help--- + Allows the creation of a dedicated hardware domain distinct from + domain 0 that manages devices without needing access to other + privileged functionality such as the ability to manage domains. + This requires that the actual domain 0 be a stub domain that + constructs the actual hardware domain instead of initializing the + hardware itself. Because the hardware domain needs access to + hypercalls not available to unprivileged guests, an XSM policy + is required to properly define the privilege of these domains. + + This feature does nothing if the "hardware_dom" boot parameter is + not present. If this feature is being used for security, it should + be combined with an IOMMU in strict mode. + + If unsure, say N. + +# Enable/Disable XSM support +config XSM + bool "Xen Security Modules support" + default n + ---help--- + Enables the security framework known as Xen Security Modules which + allows administrators fine-grained control over a Xen domain and + its capabilities by defining permissible interactions between domains, + the hypervisor itself, and related resources such as memory and + devices. + + If unsure, say N. + endmenu
xen/include/asm-x86/config.h +0 -4
@@ -52,10 +52,6 @@#define CONFIG_MULTIBOOT 1 -#ifdef XSM_ENABLE -#define CONFIG_LATE_HWDOM 1 -#endif -#define HZ 100#define OPT_CONSOLE_STR "vga"
xen/include/xen/sched.h +1 -1
@@ -110,7 +110,7 @@ struct evtchnu8 priority;u8 last_priority;u16 last_vcpu_id; -#ifdef XSM_ENABLE +#ifdef CONFIG_XSM union { #ifdef XSM_NEED_GENERIC_EVTCHN_SSID /*
xen/include/xsm/dummy.h +5 -5
@@ -27,9 +27,9 @@/* DO NOT implement this function; it is supposed to trigger link errors */ void __xsm_action_mismatch_detected (void ); -#ifdef XSM_ENABLE +#ifdef CONFIG_XSM -/* In XSM_ENABLE builds, this header file is included from xsm/dummy.c, and +/* In CONFIG_XSM builds, this header file is included from xsm/dummy.c, and * contains static (not inline) functions compiled to the dummy XSM module. * There is no xsm_default_t argument available, so the value from the assertion * is used to initialize the variable.
@@ -39,9 +39,9 @@ void __xsm_action_mismatch_detected(void);#define XSM_DEFAULT_VOID void#define XSM_ASSERT_ACTION (def) xsm_default_t action = def; (void)action -#else /* XSM_ENABLE */ +#else /* CONFIG_XSM */ -/* In !XSM_ENABLE builds, this header file is included from xsm/xsm.h, and +/* In !CONFIG_XSM builds, this header file is included from xsm/xsm.h, and * contains inline functions for each XSM hook. These functions also perform * compile-time checks on the xsm_default_t argument to ensure that the behavior * of the dummy XSM module is the same as the behavior with XSM disabled.
@@ -51,7 +51,7 @@ void __xsm_action_mismatch_detected(void);#define XSM_DEFAULT_VOID xsm_default_t action#define XSM_ASSERT_ACTION (def) LINKER_BUG_ON(def != action) -#endif /* XSM_ENABLE */ +#endif /* CONFIG_XSM */ static always_inline int xsm_default_action(xsm_default_t action,struct domain *src,struct domain *target)
xen/include/xsm/xsm.h +3 -3
@@ -194,7 +194,7 @@ struct xsm_operations {#endif }; -#ifdef XSM_ENABLE +#ifdef CONFIG_XSM extern struct xsm_operations *xsm_ops;
@@ -752,7 +752,7 @@ extern int unregister_xsm(struct xsm_operations *ops);extern struct xsm_operations dummy_xsm_ops;extern void xsm_fixup_ops (struct xsm_operations *ops); -#else /* XSM_ENABLE */ +#else /* CONFIG_XSM */ #include <xsm/dummy.h>
@@ -772,6 +772,6 @@ static inline int xsm_dt_init(void) }#endif -#endif /* XSM_ENABLE */ +#endif /* CONFIG_XSM */ #endif /* __XSM_H */
xen/xsm/Makefile +2 -4
@@ -1,7 +1,5 @@ obj-y += xsm_core.o -ifeq ($(XSM_ENABLE),y) -obj-y += xsm_policy.o -obj-y += dummy.o -endif +obj-$(CONFIG_XSM) += xsm_policy.o +obj-$(CONFIG_XSM) += dummy.o subdir-$(CONFIG_FLASK) += flask
Signature · 1 line
2.4.10
Re: [PATCH v2 2/2] xen: convert XSM_ENABLE to Kconfig
Doug Goldstein writes ("[Xen-devel] [PATCH v2 2/2] xen: convert XSM_ENABLE to Kconfig"):
Quoted 3 lines
Converts the existing
XSM_ENABLEflag from Config.mk toCONFIG_XSMwithinKconfig. This also re-adds the dependency ofCONFIG_FLASKonCONFIG_XSM.
Some version of these patches were applied to xen.git#staging last week as:
b36bf230 "convert FLASK_ENABLE to Kconfig"
2b2ab5d8 "convert XSM_ENABLE to Kconfig"
9754544a "fix missing XSM_ENABLE change"
They made it through to xen.git#smoke. However, osstest was not ready, so that old osstest would generate non-XSM tests when it intended to test XSM. To avoid XSM-related regressions sneaking in, these patches were referted in xen.git [1].
The corresponding osstest.git change, which is (we think) compatible with both old and new xen.git, has now made it through the osstest self-push-gate.
We can reapply the xen.git XSM/FLASK Kconfig patches now. We should check the first test report on a xen-unstable containing the reapplication, to verify that XSM is actually enabled in the XSM tests.
For the future, it would be really good if the osstest XSM tests attempted some forbidden operations and verified that they failed. If we had that at the start of all this then the config regression/incompatibility would have been caught by those tests.
Such patches to osstest would be very welcome and I'd be happy to help.
Thanks,
Ian.
[1] Also, the osstest push gate from xen.git#smoke to xen.git#master was stopped. Since the xen.git reverts have made it to #smoke it is now fine to restart the xen.git#smoke to xen.git#master push gate.
Re: [PATCH 1/2] xen: convert FLASK_ENABLE to Kconfig
In reply to Doug GoldsteinQuoted 6 lines · Doug Goldstein
Converts the Config.mk option of
FLASK_ENABLEinto aKconfigoption for the hypervisor calledCONFIG_FLASK. This commit knowingly breaks the dependent relationship onXSM_ENABLEwhich is addressed whenXSM_ENABLEis converted toKconfig.Signed-off-by Doug Goldstein <[email protected]>
Assuming that both patches in this series are applied together,
Quoted 7 lines · Doug Goldstein
The flask utilities only have dependencies on libxc so there's no downside to always building it. Distros and projects based on Xen can put these utilities into a different package and not install them for everyone. Prior to this change
FLASK_ENABLEneeds to be a top level variable however after this changeFLASK_ENABLEonly affects xen/.Signed-off-by Doug Goldstein <[email protected]>
While it is true about the dependency, enabling flask build unconditionally in toolstack will leave a xenpolicy-$VERSION installed in /boot. Not sure how that will be useful to Xen without flask support.
It is true that packager can pick that into separate package, but for people installing from source, this might be a bit confusing.
Wei.
Quoted 20 lines
--- tools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/Makefile +1
-1@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y := SUBDIRS-y += include SUBDIRS-y += libxc -SUBDIRS-$(FLASK_ENABLE) += flask +SUBDIRS-y += flask SUBDIRS-y += xenstore SUBDIRS-y += misc SUBDIRS-y += examplesSignature · 1 line
2.4.10
Quoted 9 lines · Wei Liu
Quoted 7 lines · Doug Goldstein
The flask utilities only have dependencies on libxc so there's no downside to always building it. Distros and projects based on Xen can put these utilities into a different package and not install them for everyone. Prior to this change
FLASK_ENABLEneeds to be a top level variable however after this changeFLASK_ENABLEonly affects xen/.Signed-off-by Doug Goldstein <[email protected]>
Quoted 8 lines
While it is true about the dependency, enabling flask build unconditionally in toolstack will leave a xenpolicy-$VERSION installed in /boot. Not sure how that will be useful to Xen without flask support.
It is true that packager can pick that into separate package, but for people installing from source, this might be a bit confusing.
Wei.
Wei,
This is actually not correct. The installation of that file is controlled by the ./configure script with --enable-xsmpolicy and --disable-xsmpolicy.
This patch just makes the utilities be unconditionally built.
--
Doug
Quoted 21 lines
Quoted 21 lines
--- tools/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/Makefile +1
-1@@ -4,7 +4,7 @@ include $(XEN_ROOT)/tools/Rules.mk SUBDIRS-y := SUBDIRS-y += include SUBDIRS-y += libxc -SUBDIRS-$(FLASK_ENABLE) += flask +SUBDIRS-y += flask SUBDIRS-y += xenstore SUBDIRS-y += misc SUBDIRS-y += examplesSignature · 1 line
2.4.10
Signature · 1 line
Doug Goldstein
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Wei Liu
Acked-byQuoted 19 lines · Doug Goldstein
Quoted 9 lines · Wei Liu
Quoted 7 lines · Doug Goldstein
The flask utilities only have dependencies on libxc so there's no downside to always building it. Distros and projects based on Xen can put these utilities into a different package and not install them for everyone. Prior to this change
FLASK_ENABLEneeds to be a top level variable however after this changeFLASK_ENABLEonly affects xen/.Signed-off-by Doug Goldstein <[email protected]>Quoted 8 lines
While it is true about the dependency, enabling flask build unconditionally in toolstack will leave a xenpolicy-$VERSION installed in /boot. Not sure how that will be useful to Xen without flask support.
It is true that packager can pick that into separate package, but for people installing from source, this might be a bit confusing.
Wei.
Quoted 8 lines
Wei,
This is actually not correct. The installation of that file is controlled by the ./configure script with --enable-xsmpolicy and --disable-xsmpolicy.
This patch just makes the utilities be unconditionally built.
You're right. I misread. Sorry for the noise.
Wei.
Quoted 30 lines · Wei Liu
Quoted 29 lines · Doug Goldstein
Quoted 17 lines · Wei Liu
Quoted 9 lines · Doug Goldstein
The flask utilities only have dependencies on libxc so there's no downside to always building it. Distros and projects based on Xen can
put these utilities into a different package and not install them for
everyone. Prior to this changeFLASK_ENABLEneeds to be a top level variable however after this changeFLASK_ENABLEonly affects xen/.Signed-off-by Doug Goldstein <[email protected]>While it is true about the dependency, enabling flask build unconditionally in toolstack will leave a xenpolicy-$VERSION installed
in /boot. Not sure how that will be useful to Xen without flask support.Quoted 4 lines
It is true that packager can pick that into separate package, but for people installing from source, this might be a bit confusing.
Wei.
Wei,
This is actually not correct. The installation of that file is controlled by the ./configure script with --enable-xsmpolicy and --disable-xsmpolicy.
Quoted 6 lines
Quoted 2 lines
This patch just makes the utilities be unconditionally built.
You're right. I misread. Sorry for the noise.
Acked-by Wei Liu <[email protected]>
I went to apply this but I seem to now have an extra policy file installed after my test build:
FILE_LIST.staging.x86_64 2016-01-05 14:27:58.000000000 +0000 renamed from FILE_LIST.BASE.staging.x86_64 2015-12-16 09:45:00.000000000 +0000 +0 -0
@@ -6,6 +6,7 @@
dist/install/boot/xen-4.7-unstable.gz
dist/install/boot/xen-4.gz
dist/install/boot/xen.gz
+dist/install/boot/xenpolicy-4.7-unstable
dist/install/etc
dist/install/etc/bash_completion.d
dist/install/etc/bash_completion.d/xl.sh
which on the basis of this discussion I wasn't expecting. I didn't see this new file on i686 or ARM*.
My baseline is from the last time I committed, which would be last year, so maybe something other than my current batch of patches has caused this.
I'm going to drop this one for now and (hopefully) get the rest of the batch squared away. Afterwards I'll take another look (with a new baseline filelist), but if someone can explain it in the meantime that would be super.
My pre-commit script doesn't mention xsm at all, i.e. nothing passed to ./configure nor written to .config or xen/.config.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 11 lines · Ian Campbell
which on the basis of this discussion I wasn't expecting. I didn't see this new file on i686 or ARM*.
My baseline is from the last time I committed, which would be last year, so maybe something other than my current batch of patches has caused this.
I'm going to drop this one for now and (hopefully) get the rest of the batch squared away. Afterwards I'll take another look (with a new baseline filelist), but if someone can explain it in the meantime that would be super.
So with a fresh basline I still see:
FILE_LIST.staging.x86_64 2016-01-05 15:11:15.000000000 +0000 renamed from FILE_LIST.BASE.staging.x86_64 2016-01-05 14:50:32.000000000 +0000 +0 -0
@@ -6,6 +6,7 @@
dist/install/boot/xen-4.7-unstable.gz dist/install/boot/xen-4.gz dist/install/boot/xen.gz +dist/install/boot/xenpolicy-4.7-unstable dist/install/etc dist/install/etc/bash_completion.d dist/install/etc/bash_completion.d/xl.sh
@@ -386,6 +387,12 @@ dist/install/usr/local/lib/xen/libexec dist/install/usr/local/lib/xen/libexec/qemu-bridge-helper dist/install/usr/local/sbin +dist/install/usr/local/sbin/flask-get-bool +dist/install/usr/local/sbin/flask-getenforce +dist/install/usr/local/sbin/flask-label-pci +dist/install/usr/local/sbin/flask-loadpolicy +dist/install/usr/local/sbin/flask-set-bool +dist/install/usr/local/sbin/flask-setenforce dist/install/usr/local/sbin/gdbsx dist/install/usr/local/sbin/gtracestat dist/install/usr/local/sbin/gtraceview
*** FILES DIFFER ***
On i686 and ARM* I only see the (expected) second hunk.
I think the i686 case is explainable by the lack of a hypervisor build there, but I'm unsure why ARM* and x86_64 should differ in this regard.
config/Tools.mk is y only on x86_64, not on the others, which obviously explains things, but the question is why only on x86_64 (I presume this has always been the case and it was previously masked, but I've not checked).
Ah, OK, I misread
AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])
as being default disable, actually the default is "enabled iff checkpolicy is installed" and it happens to be that it is only installed in my x86_64 build env.
So, in the end I think Wei was correct and this change will now, in some circumstances, end up installing a /boot/xenpolicy-*.
So the question is do we mind that?
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 51 lines · Ian Campbell
Quoted 11 lines · Ian Campbell
which on the basis of this discussion I wasn't expecting. I didn't see this new file on i686 or ARM*.
My baseline is from the last time I committed, which would be last year, so maybe something other than my current batch of patches has caused this.
I'm going to drop this one for now and (hopefully) get the rest of the batch squared away. Afterwards I'll take another look (with a new baseline filelist), but if someone can explain it in the meantime that would be super.
So with a fresh basline I still see:
FILE_LIST.staging.x86_64 2016-01-05 15:11:15.000000000 +0000 renamed from FILE_LIST.BASE.staging.x86_64 2016-01-05 14:50:32.000000000 +0000 +0
-0@@ -6,6 +6,7 @@dist/install/boot/xen-4.7-unstable.gz
dist/install/boot/xen-4.gz
dist/install/boot/xen.gz
+dist/install/boot/xenpolicy-4.7-unstable
dist/install/etc
dist/install/etc/bash_completion.d
dist/install/etc/bash_completion.d/xl.shFILE_LIST.staging.x86_64 2016-01-05 15:11:15.000000000 +0000 renamed from FILE_LIST.BASE.staging.x86_64 2016-01-05 14:50:32.000000000 +0000 +0
-0@@ -386,6 +387,12 @@dist/install/usr/local/lib/xen/libexec dist/install/usr/local/lib/xen/libexec/qemu-bridge-helper dist/install/usr/local/sbin
FILE_LIST.staging.x86_64 2016-01-05 15:11:15.000000000 +0000 renamed from FILE_LIST.BASE.staging.x86_64 2016-01-05 14:50:32.000000000 +0000 +6
-0+dist/install/usr/local/sbin/flask-get-bool +dist/install/usr/local/sbin/flask-getenforce +dist/install/usr/local/sbin/flask-label-pci +dist/install/usr/local/sbin/flask-loadpolicy +dist/install/usr/local/sbin/flask-set-bool +dist/install/usr/local/sbin/flask-setenforcedist/install/usr/local/sbin/gdbsx
dist/install/usr/local/sbin/gtracestat
dist/install/usr/local/sbin/gtraceview
*** FILES DIFFER ***On i686 and ARM* I only see the (expected) second hunk.
I think the i686 case is explainable by the lack of a hypervisor build there, but I'm unsure why ARM* and
x86_64should differ in this regard.
config/Tools.mkis y only onx86_64, not on the others, which obviously explains things, but the question is why only onx86_64(I presume this has always been the case and it was previously masked, but I've not checked).Ah, OK, I misread
Quoted 9 lines
AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])as being default disable, actually the default is "enabled iff checkpolicy is installed" and it happens to be that it is only installed in my
x86_64build env.So, in the end I think Wei was correct and this change will now, in some circumstances, end up installing a
/boot/xenpolicy-*.
I don't think it is related to this patch. I see an xenpoilcy file without this patch applied. As you said it only depends on availability of checkpolicy (part of generic SELinux utils, not the ones we build).
That said, let me try to answer the following question.
Quoted 2 lines
So the question is do we mind that?
We might or might not. See below.
I once submitted a patch to grub that look into /boot and generate XSM entries if there is policy file. The patch is not yet merged though.
Since there is no way at the moment to tell if xen.gz has flask enabled, my not yet upstreamed patch only matches the version number of xen.gz and xenpolicy. Installing xenpolicy when xen.gz is not flaks-capable will make grub generate an XSM entry nonetheless, which makes no sense.
Of course all the above is based on the theory that my grub patch is going to be upstreamed.
Things have changed since I first submitted that patch. Doug's Kconfig work is good. With .config installed in suitable location we can make grub grep for flask information in config, hence avoiding generating wrong entries. I think this is better solution as we don't need to use version number to match xen.gz and xenpolicy. If we go down this route we don't mind having random xenpolicy lying around in /boot.
We just need to reach an agreement on how to proceed. I would vote for the second solution.
Wei.
Quoted 1 line
Ian.
Quoted 69 lines · Wei Liu
Quoted 68 lines · Ian Campbell
Quoted 10 lines · Ian Campbell
which on the basis of this discussion I wasn't expecting. I didn't see this
new file on i686 or ARM*.My baseline is from the last time I committed, which would be last year, so
maybe something other than my current batch of patches has caused this.Quoted 7 lines
I'm going to drop this one for now and (hopefully) get the rest of the
batch squared away. Afterwards I'll take another look (with a new baseline
filelist), but if someone can explain it in the meantime that would be
super.So with a fresh basline I still see:
--- ../FILE_LIST.BASE.staging.x86_64 2016-01-05 14:50:32.000000000 +0000
+++ ../FILE_LIST.staging.x86_64 2016-01-05 15:11:15.000000000 +0000(quoted diff) +0
-0@@ -6,6 +6,7 @@dist/install/boot/xen-4.7-unstable.gz
dist/install/boot/xen-4.gz
dist/install/boot/xen.gz
+dist/install/boot/xenpolicy-4.7-unstable
dist/install/etc
dist/install/etc/bash_completion.d
dist/install/etc/bash_completion.d/xl.sh(quoted diff) +0
-0@@ -386,6 +387,12 @@dist/install/usr/local/lib/xen/libexec dist/install/usr/local/lib/xen/libexec/qemu-bridge-helper dist/install/usr/local/sbin
(quoted diff) +6
-0+dist/install/usr/local/sbin/flask-get-bool +dist/install/usr/local/sbin/flask-getenforce +dist/install/usr/local/sbin/flask-label-pci +dist/install/usr/local/sbin/flask-loadpolicy +dist/install/usr/local/sbin/flask-set-bool +dist/install/usr/local/sbin/flask-setenforcedist/install/usr/local/sbin/gdbsx
dist/install/usr/local/sbin/gtracestat
dist/install/usr/local/sbin/gtraceview
*** FILES DIFFER ***On i686 and ARM* I only see the (expected) second hunk.
I think the i686 case is explainable by the lack of a hypervisor build there, but I'm unsure why ARM* and
x86_64should differ in this regard.
config/Tools.mkis y only onx86_64, not on the others, which obviously explains things, but the question is why only onx86_64(I presume this has
always been the case and it was previously masked, but I've not checked).Ah, OK, I misread
AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])as being default disable, actually the default is "enabled iff checkpolicy
is installed" and it happens to be that it is only installed in myx86_64
build env.
Quoted 7 lines
Quoted 4 lines
So, in the end I think Wei was correct and this change will now, in some
circumstances, end up installing a/boot/xenpolicy-*.I don't think it is related to this patch. I see an xenpoilcy file without this patch applied.
With XSM disabled?
Quoted 2 lines
As you said it only depends on availability
of checkpolicy (part of generic SELinux utils, not the ones we build).
But then why does this file only show up for me with this patch applied?
You initially objected to this patch because you thought it would add this file, but it seems like you have always had it. Is the answer just that you only just found that you always had it?
Quoted 8 lines
That said, let me try to answer the following question.
Quoted 2 lines
So the question is do we mind that?
We might or might not. See below.
Quoted 7 lines
I once submitted a patch to grub that look into /boot and generate XSM entries if there is policy file. The patch is not yet merged though.
Since there is no way at the moment to tell if xen.gz has flask enabled, my not yet upstreamed patch only matches the version number of xen.gz and xenpolicy. Installing xenpolicy when xen.gz is not flaks-capable will make grub generate an XSM entry nonetheless, which makes no sense.
Indeed.
Quoted 10 lines
Of course all the above is based on the theory that my grub patch is going to be upstreamed.
Things have changed since I first submitted that patch. Doug's
Kconfigwork is good. With .config installed in suitable location we can make grub grep for flask information in config, hence avoiding generating wrong entries. I think this is better solution as we don't need to use version number to match xen.gz and xenpolicy. If we go down this route we don't mind having random xenpolicy lying around in /boot.
Quoted 2 lines
We just need to reach an agreement on how to proceed. I would vote for the second solution.
Which is what? This patch as is? (and what is the first proposition?)
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 80 lines · Ian Campbell
Quoted 69 lines · Wei Liu
Quoted 68 lines · Ian Campbell
Quoted 10 lines · Ian Campbell
which on the basis of this discussion I wasn't expecting. I didn't see this
new file on i686 or ARM*.My baseline is from the last time I committed, which would be last year, so
maybe something other than my current batch of patches has caused this.Quoted 7 lines
I'm going to drop this one for now and (hopefully) get the rest of the
batch squared away. Afterwards I'll take another look (with a new baseline
filelist), but if someone can explain it in the meantime that would be
super.So with a fresh basline I still see:
--- ../FILE_LIST.BASE.staging.x86_64 2016-01-05 14:50:32.000000000 +0000
+++ ../FILE_LIST.staging.x86_64 2016-01-05 15:11:15.000000000 +0000(quoted diff) +0
-0@@ -6,6 +6,7 @@dist/install/boot/xen-4.7-unstable.gz
dist/install/boot/xen-4.gz
dist/install/boot/xen.gz
+dist/install/boot/xenpolicy-4.7-unstable
dist/install/etc
dist/install/etc/bash_completion.d
dist/install/etc/bash_completion.d/xl.sh(quoted diff) +0
-0@@ -386,6 +387,12 @@dist/install/usr/local/lib/xen/libexec dist/install/usr/local/lib/xen/libexec/qemu-bridge-helper dist/install/usr/local/sbin
(quoted diff) +6
-0+dist/install/usr/local/sbin/flask-get-bool +dist/install/usr/local/sbin/flask-getenforce +dist/install/usr/local/sbin/flask-label-pci +dist/install/usr/local/sbin/flask-loadpolicy +dist/install/usr/local/sbin/flask-set-bool +dist/install/usr/local/sbin/flask-setenforcedist/install/usr/local/sbin/gdbsx
dist/install/usr/local/sbin/gtracestat
dist/install/usr/local/sbin/gtraceview
*** FILES DIFFER ***On i686 and ARM* I only see the (expected) second hunk.
I think the i686 case is explainable by the lack of a hypervisor build there, but I'm unsure why ARM* and
x86_64should differ in this regard.
config/Tools.mkis y only onx86_64, not on the others, which obviously explains things, but the question is why only onx86_64(I presume this has
always been the case and it was previously masked, but I've not checked).Ah, OK, I misread
AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])as being default disable, actually the default is "enabled iff checkpolicy
is installed" and it happens to be that it is only installed in myx86_64
build env.Quoted 7 lines
Quoted 4 lines
So, in the end I think Wei was correct and this change will now, in some
circumstances, end up installing a/boot/xenpolicy-*.I don't think it is related to this patch. I see an xenpoilcy file without this patch applied.
With XSM disabled?
Quoted 9 lines
Quoted 2 lines
As you said it only depends on availability
of checkpolicy (part of generic SELinux utils, not the ones we build).But then why does this file only show up for me with this patch applied?
You initially objected to this patch because you thought it would add this file, but it seems like you have always had it. Is the answer just that you only just found that you always had it?
Hmm... After I make distclean, things changed.
So to be clear: without this patch applied, I don't have xenpolicy file even if checkpolicy is available. This patch does alter the behaviour somehow.
I'm in the middle of rebasing one patch series, so I haven't looked into all the details.
Quoted 28 lines
Quoted 8 lines
That said, let me try to answer the following question.
Quoted 2 lines
So the question is do we mind that?
We might or might not. See below.
Quoted 7 lines
I once submitted a patch to grub that look into /boot and generate XSM entries if there is policy file. The patch is not yet merged though.
Since there is no way at the moment to tell if xen.gz has flask enabled, my not yet upstreamed patch only matches the version number of xen.gz and xenpolicy. Installing xenpolicy when xen.gz is not flaks-capable will make grub generate an XSM entry nonetheless, which makes no sense.
Indeed.
Quoted 9 lines
Of course all the above is based on the theory that my grub patch is going to be upstreamed.
Things have changed since I first submitted that patch. Doug's
Kconfigwork is good. With .config installed in suitable location we can make grub grep for flask information in config, hence avoiding generating wrong entries. I think this is better solution as we don't need to use version number to match xen.gz and xenpolicy. If we go down this route we don't mind having random xenpolicy lying around in /boot.
Quoted 5 lines
Quoted 2 lines
We just need to reach an agreement on how to proceed. I would vote for the second solution.
Which is what? This patch as is? (and what is the first proposition?)
That was referring to grub generating XSM entries. First solution is my not yet upstream patch; second is to make gurb grep .config for flask information.
Wei.
Quoted 1 line
Ian.
Quoted 131 lines · Wei Liu
Quoted 80 lines · Ian Campbell
Quoted 69 lines · Wei Liu
Quoted 68 lines · Ian Campbell
Quoted 10 lines · Ian Campbell
which on the basis of this discussion I wasn't expecting. I didn't see this
new file on i686 or ARM*.My baseline is from the last time I committed, which would be last year, so
maybe something other than my current batch of patches has caused this.Quoted 7 lines
I'm going to drop this one for now and (hopefully) get the rest of the
batch squared away. Afterwards I'll take another look (with a new baseline
filelist), but if someone can explain it in the meantime that would be
super.So with a fresh basline I still see:
--- ../FILE_LIST.BASE.staging.x86_64 2016-01-05 14:50:32.000000000
+0000
+++ ../FILE_LIST.staging.x86_64 2016-01-05 15:11:15.000000000 +0000(quoted diff) +7
-0@@ -6,6 +6,7 @@ dist/install/boot/xen-4.7-unstable.gz dist/install/boot/xen-4.gz dist/install/boot/xen.gz +dist/install/boot/xenpolicy-4.7-unstable dist/install/etc dist/install/etc/bash_completion.d dist/install/etc/bash_completion.d/xl.sh@@ -386,6 +387,12 @@ dist/install/usr/local/lib/xen/libexec dist/install/usr/local/lib/xen/libexec/qemu-bridge-helper dist/install/usr/local/sbin +dist/install/usr/local/sbin/flask-get-bool +dist/install/usr/local/sbin/flask-getenforce +dist/install/usr/local/sbin/flask-label-pci +dist/install/usr/local/sbin/flask-loadpolicy +dist/install/usr/local/sbin/flask-set-bool +dist/install/usr/local/sbin/flask-setenforce dist/install/usr/local/sbin/gdbsx dist/install/usr/local/sbin/gtracestat dist/install/usr/local/sbin/gtraceview*** FILES DIFFER ***
On i686 and ARM* I only see the (expected) second hunk.
I think the i686 case is explainable by the lack of a hypervisor build there, but I'm unsure why ARM* and
x86_64should differ in this regard.
config/Tools.mkis y only onx86_64, not on the others, which obviously explains things, but the question is why only onx86_64(I presume this has
always been the case and it was previously masked, but I've not checked).Ah, OK, I misread
AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])as being default disable, actually the default is "enabled iff checkpolicy
is installed" and it happens to be that it is only installed in myx86_64
build env.Quoted 7 lines
Quoted 4 lines
So, in the end I think Wei was correct and this change will now, in some
circumstances, end up installing a/boot/xenpolicy-*.I don't think it is related to this patch. I see an xenpoilcy file without this patch applied.
With XSM disabled?
Quoted 9 lines
Quoted 2 lines
As you said it only depends on availability
of checkpolicy (part of generic SELinux utils, not the ones we build).But then why does this file only show up for me with this patch applied?
You initially objected to this patch because you thought it would add this file, but it seems like you have always had it. Is the answer just that you only just found that you always had it?
Hmm... After I make distclean, things changed.
So to be clear: without this patch applied, I don't have xenpolicy file even if checkpolicy is available. This patch does alter the behaviour somehow.
I'm in the middle of rebasing one patch series, so I haven't looked into all the details.
Quoted 31 lines
Quoted 8 lines
That said, let me try to answer the following question.
Quoted 2 lines
So the question is do we mind that?
We might or might not. See below.
Quoted 7 lines
I once submitted a patch to grub that look into /boot and generate XSM entries if there is policy file. The patch is not yet merged though.
Since there is no way at the moment to tell if xen.gz has flask enabled, my not yet upstreamed patch only matches the version number of xen.gz and xenpolicy. Installing xenpolicy when xen.gz is not flaks-capable will make grub generate an XSM entry nonetheless, which makes no sense.
Indeed.
Quoted 12 lines
Of course all the above is based on the theory that my grub patch is going to be upstreamed.
Things have changed since I first submitted that patch. Doug's
Kconfigwork is good. With .config installed in suitable location we can make grub grep for flask information in config, hence avoiding generating wrong entries. I think this is better solution as we don't need to use version number to match xen.gz and xenpolicy. If we go down this route we don't mind having random xenpolicy lying around in /boot.We just need to reach an agreement on how to proceed. I would vote for the second solution.
Quoted 10 lines
Quoted 2 lines
Which is what? This patch as is? (and what is the first proposition?)
That was referring to grub generating XSM entries. First solution is my not yet upstream patch; second is to make gurb grep .config for flask information.
Wei.
Quoted 1 line
Ian.
Ok so I'm at a loss what steps I need to take. I've submitted patches to put the config in /boot so that this check can be made but there's a disagreement if that's even necessary or not.
Do I need to supply a patch to make --disable-xsmpolicy the default so that this change doesn't generate the policy by default? The point of this patch is to compile the necessarily bits always which will help shake out bugs earlier. If we don't want the policy file to be installed then we should use the proper setting for that and not the fact that the utility isn't being compiled.
Signature · 1 line
Doug Goldstein
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
On Fri, Jan 08, 2016 at 12:49:07PM -0600, Doug Goldstein wrote:
[...]
Quoted 4 lines
Ok so I'm at a loss what steps I need to take. I've submitted patches to put the config in /boot so that this check can be made but there's a disagreement if that's even necessary or not.
That's a bit unfortunate. :-(
But if I'm not mistaken that's orthogonal to this problem, right? That's one more step down the road regarding grub integration.
Quoted 7 lines
Do I need to supply a patch to make --disable-xsmpolicy the default so that this change doesn't generate the policy by default? The point of this patch is to compile the necessarily bits always which will help shake out bugs earlier. If we don't want the policy file to be installed then we should use the proper setting for that and not the fact that the utility isn't being compiled.
I think one solution would be to modify flask/Makefile to guard policy compilation against (FLASK_ENABLE && FLASK_POLICY).
What do you think? Admittedly I haven't followed closely all the KConfig work so I might be talking nonsense.
Ian and Ian?
Wei.
Quoted 3 lines
Signature · 1 line
Doug Goldstein
Quoted 23 lines · Wei Liu
On Fri, Jan 08, 2016 at 12:49:07PM -0600, Doug Goldstein wrote:
[...]Quoted 4 lines
Ok so I'm at a loss what steps I need to take. I've submitted patches to put the config in /boot so that this check can be made but there's a disagreement if that's even necessary or not.
That's a bit unfortunate. :-(
But if I'm not mistaken that's orthogonal to this problem, right? That's one more step down the road regarding grub integration.
Quoted 7 lines
Do I need to supply a patch to make --disable-xsmpolicy the default so that this change doesn't generate the policy by default? The point of this patch is to compile the necessarily bits always which will help shake out bugs earlier. If we don't want the policy file to be installed then we should use the proper setting for that and not the fact that the utility isn't being compiled.
I think one solution would be to modify flask/Makefile to guard policy compilation against (
FLASK_ENABLE&&FLASK_POLICY).
Quoted 6 lines
What do you think? Admittedly I haven't followed closely all the KConfig work so I might be talking nonsense.
Ian and Ian?
Wei.
Wei (and Ian and Ian and Daniel),
There's already a guard against compiling the policy in the tools/ directory's configure script called --{enable,disable}-xsmpolicy What I could do is disable it by default because it is currently enabled by default.
I honestly think that would be an improvement because we would compile all the source code (causing us to shake bugs out earlier) but only generate the policy when the user explicitly requests it. Right now the policy is made whenever the utilities are compiled.
Let me know if that sounds appealing to you.
Thanks.
Signature · 1 line
Doug Goldstein
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 38 lines · Doug Goldstein
Quoted 23 lines · Wei Liu
On Fri, Jan 08, 2016 at 12:49:07PM -0600, Doug Goldstein wrote:
[...]Quoted 4 lines
Ok so I'm at a loss what steps I need to take. I've submitted patches to put the config in /boot so that this check can be made but there's a disagreement if that's even necessary or not.
That's a bit unfortunate. :-(
But if I'm not mistaken that's orthogonal to this problem, right? That's one more step down the road regarding grub integration.
Quoted 7 lines
Do I need to supply a patch to make --disable-xsmpolicy the default so that this change doesn't generate the policy by default? The point of this patch is to compile the necessarily bits always which will help shake out bugs earlier. If we don't want the policy file to be installed then we should use the proper setting for that and not the fact that the utility isn't being compiled.
I think one solution would be to modify flask/Makefile to guard policy compilation against (
FLASK_ENABLE&&FLASK_POLICY).Quoted 6 lines
What do you think? Admittedly I haven't followed closely all the KConfig work so I might be talking nonsense.
Ian and Ian?
Wei.
Wei (and Ian and Ian and Daniel),
There's already a guard against compiling the policy in the
tools/directory's configure script called --{enable,disable}-xsmpolicy What I could do is disable it by default because it is currently enabled by default.
Quoted 7 lines
I honestly think that would be an improvement because we would compile all the source code (causing us to shake bugs out earlier) but only generate the policy when the user explicitly requests it. Right now the policy is made whenever the utilities are compiled.
Let me know if that sounds appealing to you.
Fine by me.
I don't really have a strong opinion at this point. My original concern that the installed xenpolicy file interferes with grub was based on the assumption that we only had version numbers as indicator to match hypervisor binary and xenpolicy file. But now since I think there is better way to generate grub entry I don't think my objection based on the (bad) assumption to this patch is relevant anymore.
Wei.
Quoted 4 lines
Thanks.
Signature · 1 line
Doug Goldstein
Quoted 84 lines · Wei Liu
Quoted 51 lines · Ian Campbell
Quoted 11 lines · Ian Campbell
which on the basis of this discussion I wasn't expecting. I didn't see this new file on i686 or ARM*.
My baseline is from the last time I committed, which would be last year, so maybe something other than my current batch of patches has caused this.
I'm going to drop this one for now and (hopefully) get the rest of the batch squared away. Afterwards I'll take another look (with a new baseline filelist), but if someone can explain it in the meantime that would be super.
So with a fresh basline I still see:
FILE_LIST.staging.x86_64 2016-01-05 15:11:15.000000000 +0000 renamed from FILE_LIST.BASE.staging.x86_64 2016-01-05 14:50:32.000000000 +0000 +7
-0@@ -6,6 +6,7 @@ dist/install/boot/xen-4.7-unstable.gz dist/install/boot/xen-4.gz dist/install/boot/xen.gz +dist/install/boot/xenpolicy-4.7-unstable dist/install/etc dist/install/etc/bash_completion.d dist/install/etc/bash_completion.d/xl.sh@@ -386,6 +387,12 @@ dist/install/usr/local/lib/xen/libexec dist/install/usr/local/lib/xen/libexec/qemu-bridge-helper dist/install/usr/local/sbin +dist/install/usr/local/sbin/flask-get-bool +dist/install/usr/local/sbin/flask-getenforce +dist/install/usr/local/sbin/flask-label-pci +dist/install/usr/local/sbin/flask-loadpolicy +dist/install/usr/local/sbin/flask-set-bool +dist/install/usr/local/sbin/flask-setenforce dist/install/usr/local/sbin/gdbsx dist/install/usr/local/sbin/gtracestat dist/install/usr/local/sbin/gtraceview*** FILES DIFFER ***
On i686 and ARM* I only see the (expected) second hunk.
I think the i686 case is explainable by the lack of a hypervisor build there, but I'm unsure why ARM* and
x86_64should differ in this regard.
config/Tools.mkis y only onx86_64, not on the others, which obviously explains things, but the question is why only onx86_64(I presume this has always been the case and it was previously masked, but I've not checked).Ah, OK, I misread
Quoted 9 lines
AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])as being default disable, actually the default is "enabled iff checkpolicy is installed" and it happens to be that it is only installed in my
x86_64build env.So, in the end I think Wei was correct and this change will now, in some circumstances, end up installing a
/boot/xenpolicy-*.I don't think it is related to this patch. I see an xenpoilcy file without this patch applied. As you said it only depends on availability of checkpolicy (part of generic SELinux utils, not the ones we build).
That said, let me try to answer the following question.
Quoted 2 lines
So the question is do we mind that?
We might or might not. See below.
I once submitted a patch to grub that look into /boot and generate XSM entries if there is policy file. The patch is not yet merged though.
Since there is no way at the moment to tell if xen.gz has flask enabled, my not yet upstreamed patch only matches the version number of xen.gz and xenpolicy. Installing xenpolicy when xen.gz is not flaks-capable will make grub generate an XSM entry nonetheless, which makes no sense.
Of course all the above is based on the theory that my grub patch is going to be upstreamed.
Quoted 6 lines
Things have changed since I first submitted that patch. Doug's
Kconfigwork is good. With .config installed in suitable location we can make grub grep for flask information in config, hence avoiding generating wrong entries. I think this is better solution as we don't need to use version number to match xen.gz and xenpolicy. If we go down this route we don't mind having random xenpolicy lying around in /boot.
So I submitted a patch to put the .config in /boot to have the ability to do this. I figured it needed to be in /boot because that's how the existing 20_linux_xen but there's some disagreement on the location. If we can resolve that I'll happily update the 20_linux_xen patch as well.
http://lists.xenproject.org/archives/html/xen-devel/2015-12/msg02369.html
Quoted 8 lines
We just need to reach an agreement on how to proceed. I would vote for the second solution.
Wei.
Quoted 1 line
Ian.
Signature · 1 line
Doug Goldstein
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
Quoted 109 lines · Doug Goldstein
Quoted 101 lines · Wei Liu
Quoted 71 lines · Ian Campbell
Quoted 10 lines · Ian Campbell
which on the basis of this discussion I wasn't expecting. I didn't see this
new file on i686 or ARM*.My baseline is from the last time I committed, which would be last year, so
maybe something other than my current batch of patches has caused this.Quoted 7 lines
I'm going to drop this one for now and (hopefully) get the rest of the
batch squared away. Afterwards I'll take another look (with a new baseline
filelist), but if someone can explain it in the meantime that would be
super.So with a fresh basline I still see:
--- ../FILE_LIST.BASE.staging.x86_64 2016-01-05 14:50:32.000000000 +0000
+++ ../FILE_LIST.staging.x86_64 2016-01-05 15:11:15.000000000 +0000(quoted diff) +0
-0@@ -6,6 +6,7 @@dist/install/boot/xen-4.7-unstable.gz
dist/install/boot/xen-4.gz
dist/install/boot/xen.gz
+dist/install/boot/xenpolicy-4.7-unstable
dist/install/etc
dist/install/etc/bash_completion.d
dist/install/etc/bash_completion.d/xl.sh(quoted diff) +0
-0@@ -386,6 +387,12 @@dist/install/usr/local/lib/xen/libexec dist/install/usr/local/lib/xen/libexec/qemu-bridge-helper dist/install/usr/local/sbin
(quoted diff) +6
-0+dist/install/usr/local/sbin/flask-get-bool +dist/install/usr/local/sbin/flask-getenforce +dist/install/usr/local/sbin/flask-label-pci +dist/install/usr/local/sbin/flask-loadpolicy +dist/install/usr/local/sbin/flask-set-bool +dist/install/usr/local/sbin/flask-setenforcedist/install/usr/local/sbin/gdbsx
dist/install/usr/local/sbin/gtracestat
dist/install/usr/local/sbin/gtraceview
*** FILES DIFFER ***On i686 and ARM* I only see the (expected) second hunk.
I think the i686 case is explainable by the lack of a hypervisor build
there, but I'm unsure why ARM* andx86_64should differ in this regard.
config/Tools.mkis y only onx86_64, not on the others, which obviously
explains things, but the question is why only onx86_64(I presume this has
always been the case and it was previously masked, but I've not checked).Ah, OK, I misread
AX_ARG_DEFAULT_ENABLE([xsmpolicy], [Disable XSM policy compilation])as being default disable, actually the default is "enabled iff checkpolicy
is installed" and it happens to be that it is only installed in myx86_64
build env.Quoted 4 lines
So, in the end I think Wei was correct and this change will now, in some
circumstances, end up installing a/boot/xenpolicy-*.I don't think it is related to this patch. I see an xenpoilcy file without this patch applied. As you said it only depends on availability of checkpolicy (part of generic SELinux utils, not the ones we build).
That said, let me try to answer the following question.
Quoted 2 lines
So the question is do we mind that?
We might or might not. See below.
I once submitted a patch to grub that look into /boot and generate XSM entries if there is policy file. The patch is not yet merged though.
Since there is no way at the moment to tell if xen.gz has flask enabled,
my not yet upstreamed patch only matches the version number of xen.gz and
xenpolicy. Installing xenpolicy when xen.gz is not flaks-capable will make grub generate an XSM entry nonetheless, which makes no sense.Of course all the above is based on the theory that my grub patch is going to be upstreamed.
Quoted 6 lines
Things have changed since I first submitted that patch. Doug's
Kconfigwork is good. With .config installed in suitable location we can make grub grep for flask information in config, hence avoiding generating wrong entries. I think this is better solution as we don't need to use version number to match xen.gz and xenpolicy. If we go down this route we don't mind having random xenpolicy lying around in /boot.
Quoted 6 lines
So I submitted a patch to put the .config in /boot to have the ability to do this. I figured it needed to be in /boot because that's how the existing 20_linux_xen but there's some disagreement on the location. If we can resolve that I'll happily update the 20_linux_xen patch as well.
http://lists.xenproject.org/archives/html/xen-devel/2015-12/msg02369.html
It would be worth referring that thread back to this one too.
Ian.
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel