android_kernel_oneplus_msm8998/security/integrity
Daniel Glöckner 08e589a97d ima: accept previously set IMA_NEW_FILE
commit 1ac202e978e18f045006d75bd549612620c6ec3a upstream.

Modifying the attributes of a file makes ima_inode_post_setattr reset
the IMA cache flags. So if the file, which has just been created,
is opened a second time before the first file descriptor is closed,
verification fails since the security.ima xattr has not been written
yet. We therefore have to look at the IMA_NEW_FILE even if the file
already existed.

With this patch there should no longer be an error when cat tries to
open testfile:

$ rm -f testfile
$ ( echo test >&3 ; touch testfile ; cat testfile ) 3>testfile

A file being new is no reason to accept that it is missing a digital
signature demanded by the policy.

Signed-off-by: Daniel Glöckner <dg@emlix.com>
Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 14:30:09 +02:00
..
evm EVM: Use crypto_memneq() for digest comparisons 2016-02-17 12:31:04 -08:00
ima ima: accept previously set IMA_NEW_FILE 2017-05-25 14:30:09 +02:00
digsig.c integrity: prevent loading untrusted certificates on the IMA trusted keyring 2015-10-09 15:31:18 -04:00
digsig_asymmetric.c integrity: do zero padding of the key id 2014-10-06 17:33:27 +01:00
iint.c integrity: add validity checks for 'path' parameter 2015-05-21 13:59:28 -04:00
integrity.h integrity: add validity checks for 'path' parameter 2015-05-21 13:59:28 -04:00
integrity_audit.c Merge git://git.infradead.org/users/eparis/audit 2014-04-12 12:38:53 -07:00
Kconfig kconfig: use bool instead of boolean for type definition attributes 2015-01-07 13:08:04 +01:00
Makefile integrity: make integrity files as 'integrity' module 2014-09-09 10:28:58 -04:00