linux/security/integrity/evm
Dmitry Kasatkin 3dcbad52cf evm: properly handle INTEGRITY_NOXATTRS EVM status
Unless an LSM labels a file during d_instantiate(), newly created
files are not labeled with an initial security.evm xattr, until
the file closes.  EVM, before allowing a protected, security xattr
to be written, verifies the existing 'security.evm' value is good.
For newly created files without a security.evm label, this
verification prevents writing any protected, security xattrs,
until the file closes.

Following is the example when this happens:
fd = open("foo", O_CREAT | O_WRONLY, 0644);
setxattr("foo", "security.SMACK64", value, sizeof(value), 0);
close(fd);

While INTEGRITY_NOXATTRS status is handled in other places, such
as evm_inode_setattr(), it does not handle it in all cases in
evm_protect_xattr().  By limiting the use of INTEGRITY_NOXATTRS to
newly created files, we can now allow setting "protected" xattrs.

Changelog:
- limit the use of INTEGRITY_NOXATTRS to IMA identified new files

Signed-off-by: Dmitry Kasatkin <d.kasatkin@samsung.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org>  3.14+
2014-09-09 10:26:10 -04:00
..
evm_crypto.c evm: replace HMAC version with attribute mask 2014-06-12 17:58:06 -04:00
evm_main.c evm: properly handle INTEGRITY_NOXATTRS EVM status 2014-09-09 10:26:10 -04:00
evm_posix_acl.c ima: fix script messages 2013-10-25 13:17:19 -04:00
evm_secfs.c security: integrity: Use a more current logging style 2014-03-07 12:15:21 -05:00
evm.h evm: replace HMAC version with attribute mask 2014-06-12 17:58:06 -04:00
Kconfig evm: provide option to protect additional SMACK xattrs 2014-06-12 17:58:06 -04:00
Makefile evm: posix acls modify i_mode 2011-09-14 15:24:51 -04:00