Skip to contentSkip to conversation

integrity: build scripts changes

PATCH In review Dmitry Kasatkin 2 participants 8 messages Sep 3, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover integrity: build scripts changes

Hi,

These patches introduce few changes to integrity subsystem build scripts. Patch descriptions provide detailed explanations.

Changes in v2:
- use 'menu' instead of 'menuconfig' to keep integrity as security option

- Dmitry

Dmitry Kasatkin (3):
integrity: move asymmetric keys config option
integrity: move integrity subsystem options to a separate menu
integrity: make all integrity components as integrity module

 security/integrity/Kconfig     | 38 ++++++++++++++++++++++++--------------
 security/integrity/Makefile    |  6 +++---
 security/integrity/evm/Kconfig |  9 +--------
 security/integrity/ima/Kconfig |  3 +--
 4 files changed, 29 insertions(+), 27 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v2 1/3 integrity: move asymmetric keys config option

For better visual appearance it is better to co-locate asymmetric key option together with signature support.

---
 security/integrity/Kconfig | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
security/integrity/Kconfig +12 -12
index 245c6d9..f79d853 100644
@@ -17,6 +17,18 @@ config INTEGRITY_SIGNATURE
 	  This is useful for evm and module keyrings, when keys are
 	  usually only added from initramfs.
 
+config INTEGRITY_ASYMMETRIC_KEYS
+	boolean "Enable asymmetric keys support"
+	depends on INTEGRITY_SIGNATURE
+	default n
+        select ASYMMETRIC_KEY_TYPE
+        select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
+        select PUBLIC_KEY_ALGO_RSA
+        select X509_CERTIFICATE_PARSER
+	help
+	  This option enables digital signature verification using
+	  asymmetric keys.
+
 config INTEGRITY_AUDIT
 	bool "Enables integrity auditing support "
 	depends on INTEGRITY && AUDIT
@@ -32,17 +44,5 @@ config INTEGRITY_AUDIT
 	  be enabled by specifying 'integrity_audit=1' on the kernel
 	  command line.
 
-config INTEGRITY_ASYMMETRIC_KEYS
-	boolean "Enable asymmetric keys support"
-	depends on INTEGRITY_SIGNATURE
-	default n
-        select ASYMMETRIC_KEY_TYPE
-        select ASYMMETRIC_PUBLIC_KEY_SUBTYPE
-        select PUBLIC_KEY_ALGO_RSA
-        select X509_CERTIFICATE_PARSER
-	help
-	  This option enables digital signature verification using
-	  asymmetric keys.
-
 source security/integrity/ima/Kconfig
 source security/integrity/evm/Kconfig
Signature · 1 line
1.9.1
#2 lore raw

PATCH v2 2/3 integrity: move integrity subsystem options to a separate menu

In reply to Dmitry Kasatkin

Integrity subsystem got lots of options and takes more than half of security menu.

This patch moves integrity subsystem options to a separate menu. It does not affect existing configuration. Re-configuration is not needed.

Changes in v2:
- previous patch moved integrity out of the 'security' menu. This version keeps integrity as a security option (Mimi).

---
 security/integrity/Kconfig     | 14 ++++++++++++--
 security/integrity/evm/Kconfig |  9 +--------
 security/integrity/ima/Kconfig |  3 +--
 3 files changed, 14 insertions(+), 12 deletions(-)
security/integrity/Kconfig +12 -2
index f79d853..a734a83 100644
@@ -1,7 +1,13 @@
 #
 config INTEGRITY
-	def_bool y
-	depends on IMA || EVM
+	bool "Integrity subsystem support"
+	depends on SECURITY
+	default y
+
+if INTEGRITY
+
+menu "Options"
+
 
 config INTEGRITY_SIGNATURE
 	boolean "Digital signature verification using multiple keyrings"
@@ -46,3 +52,7 @@ config INTEGRITY_AUDIT
 
 source security/integrity/ima/Kconfig
 source security/integrity/evm/Kconfig
+
+endmenu
+
+endif   # if INTEGRITY
security/integrity/evm/Kconfig +1 -8
index d606f3d..df20a2f 100644
@@ -1,6 +1,6 @@
 config EVM
 	boolean "EVM support"
-	depends on SECURITY
+	depends on INTEGRITY
 	select KEYS
 	select ENCRYPTED_KEYS
 	select CRYPTO_HMAC
@@ -12,10 +12,6 @@ config EVM
 
 	  If you are unsure how to answer this question, answer N.
 
-if EVM
-
-menu "EVM options"
-
 config EVM_ATTR_FSUUID
 	bool "FSUUID (version 2)"
 	default y
@@ -47,6 +43,3 @@ config EVM_EXTRA_SMACK_XATTRS
 	  additional info to the calculation, requires existing EVM
 	  labeled file systems to be relabeled.
 
-endmenu
-
-endif
security/integrity/ima/Kconfig +1 -2
index 08758fb..2477d1e 100644
@@ -2,8 +2,7 @@
 #
 config IMA
 	bool "Integrity Measurement Architecture(IMA)"
-	depends on SECURITY
-	select INTEGRITY
+	depends on INTEGRITY
 	select SECURITYFS
 	select CRYPTO
 	select CRYPTO_HMAC
Signature · 1 line
1.9.1
#3 lore raw

Re: [PATCH v2 2/3] integrity: move integrity subsystem options to a separate menu

Quoted 25 lines · Dmitry Kasatkin

Integrity subsystem got lots of options and takes more than half of security menu.

This patch moves integrity subsystem options to a separate menu. It does not affect existing configuration. Re-configuration is not needed.

Changes in v2:
- previous patch moved integrity out of the 'security' menu. This version keeps integrity as a security option (Mimi).

---
 security/integrity/Kconfig     | 14 ++++++++++++--
 security/integrity/evm/Kconfig |  9 +--------
 security/integrity/ima/Kconfig |  3 +--
 3 files changed, 14 insertions(+), 12 deletions(-)
security/integrity/Kconfig +0 -0
index f79d853..a734a83 100644
@@ -1,7 +1,13 @@
 #
 config INTEGRITY

security/integrity/Kconfig line 10

Quoted 10 lines
security/integrity/Kconfig +8 -2
-	def_bool y
-	depends on IMA || EVM
+	bool "Integrity subsystem support"
+	depends on SECURITY
+	default y
+
+if INTEGRITY
+
+menu "Options"
+

Instead of moving everything to a separate menu, I would leave the ability to enable/disable IMA and EVM on the security page, but move their options to separate pages. So unless someone wants to change the default options, they're hidden.

There are Kconfig examples for enabling the option in the parent directory and clicking on the option brings up a separate menu (eg. NET, WIRELESS).

Quoted 15 lines
security/integrity/Kconfig +4 -0
 config INTEGRITY_SIGNATURE
 	boolean "Digital signature verification using multiple keyrings"
@@ -46,3 +52,7 @@ config INTEGRITY_AUDIT
 
 source security/integrity/ima/Kconfig
 source security/integrity/evm/Kconfig
+
+endmenu
+
+endif   # if INTEGRITY
security/integrity/evm/Kconfig +0 -0
index d606f3d..df20a2f 100644

security/integrity/evm/Kconfig line 3

Quoted 4 lines
security/integrity/evm/Kconfig +1 -1
@@ -1,6 +1,6 @@
 config EVM
 	boolean "EVM support"
-	depends on SECURITY
+	depends on INTEGRITY

By adding the "if INTEGRITY", the "depends on INTEGRITY" is redundant. Please remove the depends here and in the other places.

Mimi

Quoted 35 lines
security/integrity/evm/Kconfig +0 -7
 	select KEYS
 	select ENCRYPTED_KEYS
 	select CRYPTO_HMAC
@@ -12,10 +12,6 @@ config EVM
 
 	  If you are unsure how to answer this question, answer N.
 
-if EVM
-
-menu "EVM options"
-
 config EVM_ATTR_FSUUID
 	bool "FSUUID (version 2)"
 	default y
@@ -47,6 +43,3 @@ config EVM_EXTRA_SMACK_XATTRS
 	  additional info to the calculation, requires existing EVM
 	  labeled file systems to be relabeled.
 
-endmenu
-
-endif
security/integrity/ima/Kconfig +1 -2
index 08758fb..2477d1e 100644
@@ -2,8 +2,7 @@
 #
 config IMA
 	bool "Integrity Measurement Architecture(IMA)"
-	depends on SECURITY
-	select INTEGRITY
+	depends on INTEGRITY
 	select SECURITYFS
 	select CRYPTO
 	select CRYPTO_HMAC
#4 lore raw

Re: [PATCH v2 2/3] integrity: move integrity subsystem options to a separate menu

Quoted 41 lines · Mimi Zohar
Quoted 25 lines · Dmitry Kasatkin

Integrity subsystem got lots of options and takes more than half of security menu.

This patch moves integrity subsystem options to a separate menu. It does not affect existing configuration. Re-configuration is not needed.

Changes in v2:
- previous patch moved integrity out of the 'security' menu. This version keeps integrity as a security option (Mimi).

---
 security/integrity/Kconfig     | 14 ++++++++++++--
 security/integrity/evm/Kconfig |  9 +--------
 security/integrity/ima/Kconfig |  3 +--
 3 files changed, 14 insertions(+), 12 deletions(-)
security/integrity/Kconfig +0 -0
index f79d853..a734a83 100644
@@ -1,7 +1,13 @@
 #
 config INTEGRITY

security/integrity/Kconfig line 10

Quoted 10 lines
security/integrity/Kconfig +8 -2
-	def_bool y
-	depends on IMA || EVM
+	bool "Integrity subsystem support"
+	depends on SECURITY
+	default y
+
+if INTEGRITY
+
+menu "Options"
+

Instead of moving everything to a separate menu, I would leave the ability to enable/disable IMA and EVM on the security page, but move their options to separate pages. So unless someone wants to change the default options, they're hidden.

Quoted 3 lines

There are Kconfig examples for enabling the option in the parent directory and clicking on the option brings up a separate menu (eg. NET, WIRELESS).

Hi,

I posted this patch already 3 times before. This is 4th time.

In last post you answered:

"Agreed, but this patch moves integrity out of the 'security' menu. The following keeps integrity as a security option."

Now you tell me this?

- Dmitry

Quoted 65 lines
Quoted 15 lines
security/integrity/Kconfig +4 -0
 config INTEGRITY_SIGNATURE
 	boolean "Digital signature verification using multiple keyrings"
@@ -46,3 +52,7 @@ config INTEGRITY_AUDIT
 
 source security/integrity/ima/Kconfig
 source security/integrity/evm/Kconfig
+
+endmenu
+
+endif   # if INTEGRITY
security/integrity/evm/Kconfig +0 -0
index d606f3d..df20a2f 100644

security/integrity/evm/Kconfig line 3

Quoted 4 lines
security/integrity/evm/Kconfig +1 -1
@@ -1,6 +1,6 @@
 config EVM
 	boolean "EVM support"
-	depends on SECURITY
+	depends on INTEGRITY

By adding the "if INTEGRITY", the "depends on INTEGRITY" is redundant. Please remove the depends here and in the other places.

Mimi

Quoted 26 lines
security/integrity/evm/Kconfig +0 -7
 	select KEYS
 	select ENCRYPTED_KEYS
 	select CRYPTO_HMAC
@@ -12,10 +12,6 @@ config EVM
 
 	  If you are unsure how to answer this question, answer N.
 
-if EVM
-
-menu "EVM options"
-
 config EVM_ATTR_FSUUID
 	bool "FSUUID (version 2)"
 	default y
@@ -47,6 +43,3 @@ config EVM_EXTRA_SMACK_XATTRS
 	  additional info to the calculation, requires existing EVM
 	  labeled file systems to be relabeled.
 
-endmenu
-
-endif
security/integrity/ima/Kconfig +0 -0
index 08758fb..2477d1e 100644

security/integrity/ima/Kconfig line 8

Quoted 9 lines
security/integrity/ima/Kconfig +1 -2
@@ -2,8 +2,7 @@
 #
 config IMA
 	bool "Integrity Measurement Architecture(IMA)"
-	depends on SECURITY
-	select INTEGRITY
+	depends on INTEGRITY
 	select SECURITYFS
 	select CRYPTO
 	select CRYPTO_HMAC

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw

Re: [PATCH v2 2/3] integrity: move integrity subsystem options to a separate menu

Quoted 48 lines · Dmitry Kasatkin
Quoted 41 lines · Mimi Zohar
Quoted 25 lines · Dmitry Kasatkin

Integrity subsystem got lots of options and takes more than half of security menu.

This patch moves integrity subsystem options to a separate menu. It does not affect existing configuration. Re-configuration is not needed.

Changes in v2:
- previous patch moved integrity out of the 'security' menu. This version keeps integrity as a security option (Mimi).

---
 security/integrity/Kconfig     | 14 ++++++++++++--
 security/integrity/evm/Kconfig |  9 +--------
 security/integrity/ima/Kconfig |  3 +--
 3 files changed, 14 insertions(+), 12 deletions(-)
security/integrity/Kconfig +0 -0
index f79d853..a734a83 100644
@@ -1,7 +1,13 @@
 #
 config INTEGRITY

security/integrity/Kconfig line 10

Quoted 10 lines
security/integrity/Kconfig +8 -2
-	def_bool y
-	depends on IMA || EVM
+	bool "Integrity subsystem support"
+	depends on SECURITY
+	default y
+
+if INTEGRITY
+
+menu "Options"
+

Instead of moving everything to a separate menu, I would leave the ability to enable/disable IMA and EVM on the security page, but move their options to separate pages. So unless someone wants to change the default options, they're hidden.

Quoted 3 lines

There are Kconfig examples for enabling the option in the parent directory and clicking on the option brings up a separate menu (eg. NET, WIRELESS).

Hi,

Quoted 8 lines

I posted this patch already 3 times before. This is 4th time.

In last post you answered:

"Agreed, but this patch moves integrity out of the 'security' menu. The following keeps integrity as a security option."

Now you tell me this?

The current change just doesn't look right.

[] Integrity subsystem support
[] Options

I should be able to just click on "Integrity subsystem support", not the "Options", to bring up the integrity menu. Unfortunately, "menuconfig" moves the integrity option out of the security menu.

Bringing everything under INTEGRITY is fine. All of the other security subsystems are listed in the security menu. I really don't see a problem with leaving integrity there too. For now, lets just drop the "Options" menu.

Mimi

Quoted 74 lines

- Dmitry

Quoted 56 lines
Quoted 15 lines
security/integrity/Kconfig +4 -0
 config INTEGRITY_SIGNATURE
 	boolean "Digital signature verification using multiple keyrings"
@@ -46,3 +52,7 @@ config INTEGRITY_AUDIT
 
 source security/integrity/ima/Kconfig
 source security/integrity/evm/Kconfig
+
+endmenu
+
+endif   # if INTEGRITY
security/integrity/evm/Kconfig +0 -0
index d606f3d..df20a2f 100644

security/integrity/evm/Kconfig line 3

Quoted 4 lines
security/integrity/evm/Kconfig +1 -1
@@ -1,6 +1,6 @@
 config EVM
 	boolean "EVM support"
-	depends on SECURITY
+	depends on INTEGRITY

By adding the "if INTEGRITY", the "depends on INTEGRITY" is redundant. Please remove the depends here and in the other places.

Mimi

Quoted 32 lines
security/integrity/evm/Kconfig +0 -7
 	select KEYS
 	select ENCRYPTED_KEYS
 	select CRYPTO_HMAC
@@ -12,10 +12,6 @@ config EVM
 
 	  If you are unsure how to answer this question, answer N.
 
-if EVM
-
-menu "EVM options"
-
 config EVM_ATTR_FSUUID
 	bool "FSUUID (version 2)"
 	default y
@@ -47,6 +43,3 @@ config EVM_EXTRA_SMACK_XATTRS
 	  additional info to the calculation, requires existing EVM
 	  labeled file systems to be relabeled.
 
-endmenu
-
-endif
security/integrity/ima/Kconfig +1 -2
index 08758fb..2477d1e 100644
@@ -2,8 +2,7 @@
 #
 config IMA
 	bool "Integrity Measurement Architecture(IMA)"
-	depends on SECURITY
-	select INTEGRITY
+	depends on INTEGRITY
Quoted 9 lines

security/integrity/ima/Kconfig line 8

Quoted 3 lines
security/integrity/ima/Kconfig +0 -0
 	select SECURITYFS
 	select CRYPTO
 	select CRYPTO_HMAC

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw

Re: [PATCH v2 2/3] integrity: move integrity subsystem options to a separate menu

In reply to Mimi Zohar
Quoted 41 lines · Mimi Zohar
Quoted 25 lines · Dmitry Kasatkin

Integrity subsystem got lots of options and takes more than half of security menu.

This patch moves integrity subsystem options to a separate menu. It does not affect existing configuration. Re-configuration is not needed.

Changes in v2:
- previous patch moved integrity out of the 'security' menu. This version keeps integrity as a security option (Mimi).

---
 security/integrity/Kconfig     | 14 ++++++++++++--
 security/integrity/evm/Kconfig |  9 +--------
 security/integrity/ima/Kconfig |  3 +--
 3 files changed, 14 insertions(+), 12 deletions(-)
security/integrity/Kconfig +0 -0
index f79d853..a734a83 100644
@@ -1,7 +1,13 @@
 #
 config INTEGRITY

security/integrity/Kconfig line 10

Quoted 10 lines
security/integrity/Kconfig +8 -2
-	def_bool y
-	depends on IMA || EVM
+	bool "Integrity subsystem support"
+	depends on SECURITY
+	default y
+
+if INTEGRITY
+
+menu "Options"
+

Instead of moving everything to a separate menu, I would leave the ability to enable/disable IMA and EVM on the security page, but move their options to separate pages. So unless someone wants to change the default options, they're hidden.

Quoted 3 lines

There are Kconfig examples for enabling the option in the parent directory and clicking on the option brings up a separate menu (eg. NET, WIRELESS).

Actually it is better to have as separate menu, because there are integrity level specific options there as auditing or digital signatures. It is nice to have them all in one place.

Quoted 13 lines
Quoted 13 lines
security/integrity/Kconfig +4 -0
 config INTEGRITY_SIGNATURE
 	boolean "Digital signature verification using multiple keyrings"
@@ -46,3 +52,7 @@ config INTEGRITY_AUDIT
 
 source security/integrity/ima/Kconfig
 source security/integrity/evm/Kconfig
+
+endmenu
+
+endif   # if INTEGRITY
security/integrity/evm/Kconfig +0 -1
index d606f3d..df20a2f 100644
--- a/security/integrity/evm/Kconfig
Quoted 8 lines

security/integrity/evm/Kconfig line 3

Quoted 6 lines

+++ b/security/integrity/evm/Kconfig

security/integrity/evm/Kconfig +1 -1
@@ -1,6 +1,6 @@
 config EVM
 	boolean "EVM support"
-	depends on SECURITY
+	depends on INTEGRITY

By adding the "if INTEGRITY", the "depends on INTEGRITY" is redundant. Please remove the depends here and in the other places.

Will do.

- Dmitry

Quoted 43 lines

Mimi

Quoted 26 lines
security/integrity/evm/Kconfig +0 -7
 	select KEYS
 	select ENCRYPTED_KEYS
 	select CRYPTO_HMAC
@@ -12,10 +12,6 @@ config EVM
 
 	  If you are unsure how to answer this question, answer N.
 
-if EVM
-
-menu "EVM options"
-
 config EVM_ATTR_FSUUID
 	bool "FSUUID (version 2)"
 	default y
@@ -47,6 +43,3 @@ config EVM_EXTRA_SMACK_XATTRS
 	  additional info to the calculation, requires existing EVM
 	  labeled file systems to be relabeled.
 
-endmenu
-
-endif
security/integrity/ima/Kconfig +0 -0
index 08758fb..2477d1e 100644

security/integrity/ima/Kconfig line 8

Quoted 9 lines
security/integrity/ima/Kconfig +1 -2
@@ -2,8 +2,7 @@
 #
 config IMA
 	bool "Integrity Measurement Architecture(IMA)"
-	depends on SECURITY
-	select INTEGRITY
+	depends on INTEGRITY
 	select SECURITYFS
 	select CRYPTO
 	select CRYPTO_HMAC

--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#7 lore raw

PATCH v2 3/3 integrity: make all integrity components as integrity module

In reply to Dmitry Kasatkin

Kernel print macros use KBUILD_MODNAME, which is initialized to module name. Current Makefile puts every file to its own module. So pr_xxx messages prefixed with file name instead of module. This patch makes all as a 'integrity' module the same way as it is done in evm/Makefile and ima/Makefile.

---
 security/integrity/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
security/integrity/Makefile +3 -3
index 0793f48..8d1f4bf 100644
@@ -3,11 +3,11 @@
 #
 
 obj-$(CONFIG_INTEGRITY) += integrity.o
-obj-$(CONFIG_INTEGRITY_AUDIT) += integrity_audit.o
-obj-$(CONFIG_INTEGRITY_SIGNATURE) += digsig.o
-obj-$(CONFIG_INTEGRITY_ASYMMETRIC_KEYS) += digsig_asymmetric.o
 
 integrity-y := iint.o
+integrity-$(CONFIG_INTEGRITY_AUDIT) += integrity_audit.o
+integrity-$(CONFIG_INTEGRITY_SIGNATURE) += digsig.o
+integrity-$(CONFIG_INTEGRITY_ASYMMETRIC_KEYS) += digsig_asymmetric.o
 
 subdir-$(CONFIG_IMA)			+= ima
 obj-$(CONFIG_IMA)			+= ima/
Signature · 1 line
1.9.1