瀏覽代碼

evm: provide option to protect additional SMACK xattrs

Newer versions of SMACK introduced following security xattrs:
SMACK64EXEC, SMACK64TRANSMUTE and SMACK64MMAP.

To protect these xattrs, this patch includes them in the HMAC
calculation.  However, for backwards compatibility with existing
labeled filesystems, including these xattrs needs to be
configurable.

Changelog:
- Add SMACK dependency on new option (Mimi)

Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Dmitry Kasatkin 11 年之前
父節點
當前提交
3e38df56e6
共有 2 個文件被更改,包括 22 次插入0 次删除
  1. 17 0
      security/integrity/evm/Kconfig
  2. 5 0
      security/integrity/evm/evm_main.c

+ 17 - 0
security/integrity/evm/Kconfig

@@ -30,6 +30,23 @@ config EVM_ATTR_FSUUID
 	  additional info to the calculation, requires existing EVM
 	  additional info to the calculation, requires existing EVM
 	  labeled file systems to be relabeled.
 	  labeled file systems to be relabeled.
 
 
+config EVM_EXTRA_SMACK_XATTRS
+	bool "Additional SMACK xattrs"
+	depends on EVM && SECURITY_SMACK
+	default n
+	help
+	  Include additional SMACK xattrs for HMAC calculation.
+
+	  In addition to the original security xattrs (eg. security.selinux,
+	  security.SMACK64, security.capability, and security.ima) included
+	  in the HMAC calculation, enabling this option includes newly defined
+	  Smack xattrs: security.SMACK64EXEC, security.SMACK64TRANSMUTE and
+	  security.SMACK64MMAP.
+
+	  WARNING: changing the HMAC calculation method or adding
+	  additional info to the calculation, requires existing EVM
+	  labeled file systems to be relabeled.
+
 endmenu
 endmenu
 
 
 endif
 endif

+ 5 - 0
security/integrity/evm/evm_main.c

@@ -40,6 +40,11 @@ char *evm_config_xattrnames[] = {
 #endif
 #endif
 #ifdef CONFIG_SECURITY_SMACK
 #ifdef CONFIG_SECURITY_SMACK
 	XATTR_NAME_SMACK,
 	XATTR_NAME_SMACK,
+#ifdef CONFIG_EVM_EXTRA_SMACK_XATTRS
+	XATTR_NAME_SMACKEXEC,
+	XATTR_NAME_SMACKTRANSMUTE,
+	XATTR_NAME_SMACKMMAP,
+#endif
 #endif
 #endif
 #ifdef CONFIG_IMA_APPRAISE
 #ifdef CONFIG_IMA_APPRAISE
 	XATTR_NAME_IMA,
 	XATTR_NAME_IMA,