Skip to content

Commit 3e38df5

Browse files
Dmitry KasatkinMimi Zohar
authored andcommitted
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>
1 parent d3b3367 commit 3e38df5

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

‎security/integrity/evm/Kconfig‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,23 @@ config EVM_ATTR_FSUUID
3030
additional info to the calculation, requires existing EVM
3131
labeled file systems to be relabeled.
3232

33+
config EVM_EXTRA_SMACK_XATTRS
34+
bool "Additional SMACK xattrs"
35+
depends on EVM && SECURITY_SMACK
36+
default n
37+
help
38+
Include additional SMACK xattrs for HMAC calculation.
39+
40+
In addition to the original security xattrs (eg. security.selinux,
41+
security.SMACK64, security.capability, and security.ima) included
42+
in the HMAC calculation, enabling this option includes newly defined
43+
Smack xattrs: security.SMACK64EXEC, security.SMACK64TRANSMUTE and
44+
security.SMACK64MMAP.
45+
46+
WARNING: changing the HMAC calculation method or adding
47+
additional info to the calculation, requires existing EVM
48+
labeled file systems to be relabeled.
49+
3350
endmenu
3451

3552
endif

‎security/integrity/evm/evm_main.c‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ char *evm_config_xattrnames[] = {
4040
#endif
4141
#ifdef CONFIG_SECURITY_SMACK
4242
XATTR_NAME_SMACK,
43+
#ifdef CONFIG_EVM_EXTRA_SMACK_XATTRS
44+
XATTR_NAME_SMACKEXEC,
45+
XATTR_NAME_SMACKTRANSMUTE,
46+
XATTR_NAME_SMACKMMAP,
47+
#endif
4348
#endif
4449
#ifdef CONFIG_IMA_APPRAISE
4550
XATTR_NAME_IMA,

0 commit comments

Comments
 (0)